-
Notifications
You must be signed in to change notification settings - Fork 2.1k
viewpager 中使用的问题 #624
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
原因是viewPage转载的第一个fragment会先被实例化,所以其实你在mViewPager.setAdapter的时候下一步就已经执行到A的onLazyInitView,这个时候你mViewPager.setCurrentItem(4),其实相当于已经实例化完第1个和第5个fragment了 |
@KinaZhen 代码贴下 |
代码如下 @OverRide
|
在 |
不是在 onEnterAnimationEnd() 中切回第一个,而是 手动点击 tab 切回第一个 |
@KinaZhen 是手动切回, 在 但是确实存在BUG,在这种场景下 |
Uh oh!
There was an error while loading. Please reload this page.
在viewpager 中使用fragmentStatePagerAdapter ,共有6个卡页,在调用viewPager.setAdapter 后,继续调用viewPager.setCurrentItem(4) ,(默认显示第5个卡页的意思), 这时 这个卡页下fragment显示正常,然后通过点击第一个卡页tab , 回到第一个卡页下的fragment时, 这个fragment不走onLazyInitView; 请问为什么?
The text was updated successfully, but these errors were encountered: