ViewPager offscreen page limit

前端 未结 7 2049
慢半拍i
慢半拍i 2020-11-30 04:45

Is there a way to bypass the normal behavior of ViewPager and its offscreen page limit? My ViewPager contains four fragments,

相关标签:
7条回答
  • 2020-11-30 05:32

    Simply set the offscreen limit to one.

    ViewPager mViewpager = (ViewPager)findView....
    mViewPager.setOffscreenPageLimit(1);
    
    0 讨论(0)
提交回复
热议问题