-
Notifications
You must be signed in to change notification settings - Fork 208
ViewPager
xu_whale edited this page Dec 4, 2019
·
12 revisions
一个可自动滚动可翻页的控件
该控件提供了无限滚动,自动滚动,手动切换页面等功能,更可以同TabSegment控件进行联动,开发出复杂的联动效果
ViewPager() 构造方法
[adapter(ViewPagerAdapter a)](https://github.com/momotech/MLN/wiki/ViewPager-self-adapter-ViewPagerAdapter)
设置数据和事件的适配器
获取当前控件所绑定的适配器
[autoScroll(boolean enable)](https://github.com/momotech/MLN/wiki/ViewPager-self-autoScroll-boolean)
控制是否开启自动滚动
获取当前设置的自动滚动状态
[recurrence(boolean enable)](https://github.com/momotech/MLN/wiki/ViewPager-self-recurrence-boolean)
设置是否循环滚动,默认为false
获取当前循环滚动状态
设置自动滚动的时间间隔,默认为2s
获取自动滚动的时间间隔
[showIndicator(boolean show)](https://github.com/momotech/MLN/wiki/ViewPager-self-showIndicator-boolean)
控制是否展示指示器
获取指示器的状态
[aheadLoad(boolean open)](https://github.com/momotech/MLN/wiki/ViewPager-self-aheadLoad-boolean)
控制是否开启预加载
获取是否开启预加载
endDragging(function callback) ❌
page页结束滚动时回调
滑动后选中具体页面位置回调
刷新所有的数据
[scrollToPage(number position, boolean animated)](https://github.com/momotech/MLN/wiki/ViewPager-self-scrollToPage-number-boolean)
滚动到某页
[currentPageColor(Color color)](https://github.com/momotech/MLN/wiki/ViewPager-self-currentPageColor-Color)
设置指示器当前帧的颜色
[pageDotColor(Color color)](https://github.com/momotech/MLN/wiki/ViewPager-self-pageDotColor-Color)
设置指示器默认点的颜色
获取ViewPager当前页的页数
设置预加载页面数量
设置cell将要显示回调
设置cell已经消失的回调
设置点击了某一页的回调
[setScrollEnable(boolean enable)](https://github.com/momotech/MLN/wiki/ViewPager-self-setScrollEnable-boolean)
设置是否开可滚动
设置滚动百分比回调 @version sdk1.5.0