8000 Merge branch 'bugfix/chengxi/pagerViewPageIndexError' into 'develop' · newcoderzhang/LuaViewSDK@a703d60 · GitHub
[go: up one dir, main page]

Skip to content

Commit a703d60

Browse files
author
城西
committed
Merge branch 'bugfix/chengxi/pagerViewPageIndexError' into 'develop'
修复滚动结束,pagerView页数id错误bug See merge request !36
2 parents 422419a + a9623d8 commit a703d60

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

IOS/LuaViewSDK/Classes/lvsdk/LVPagerView.m

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -597,6 +597,14 @@ - (void) callLuaWithScrolling{
597597
}
598598

599599
- (void) callLuaWithScrollEnded{
600+
{
601+
CGFloat offsetX = self.contentOffset.x;
602+< 644D /span>
CGFloat pageWidth = self.frame.size.width;
603+
CGFloat pageIndex = offsetX/pageWidth;
604+
605+
self.pageIdx = [self xindex2index:pageIndex + 0.1];
606+
[self setPageIndicatorIdx:[self xindex2index:pageIndex + 0.1]];
607+
}
600608
lv_State* l = self.lv_lview.l;
601609
if( l && self.lv_userData ){
602610
lv_checkStack32(l);

0 commit comments

Comments
 (0)
0