swiper子节点特定场景下不显示

Signed-off-by: chenxuankai1 <chenxuankai1@huawei.com>
Change-Id: I0c3a52e23a037c11bccaeaf3753d664369943679
This commit is contained in:
chenxuankai1
2022-04-12 15:07:52 +08:00
parent 63ff85dc75
commit 790506b624
@@ -386,7 +386,8 @@ void RenderSwiper::PerformLayout()
: -swiperHeight_ + prevMargin_ + nextMargin_;
}
nextItemOffset_ = -prevItemOffset_;
UpdateChildPosition(std::fmod(scrollOffset_, nextItemOffset_), currentIndex_, true);
auto childPosition = NearZero(nextItemOffset_) ? nextItemOffset_ : std::fmod(scrollOffset_, nextItemOffset_);
UpdateChildPosition(childPosition, currentIndex_, true);
quickTrunItem_ = false;
// layout indicator, indicator style in tv is different.