-
Notifications
You must be signed in to change notification settings - Fork 2.1k
我使用懒加载 我fragment嵌套fragment的那个 偶尔会出现onLazyInitView没有执行 这让我很苦恼 会造成空白问题 #838
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
栈视图截图看下,或者描述嵌套的场景,哪个Fragment不回调lazy? |
使用的是哪种Adpater? 如果是 |
FragmentPagerAdapter 我使用的是这个 !并且卡顿的那个问题 我子viewpager 嵌套的那四个fragment比较复杂!我是不是监听一下第一个fragment加载成功之后 mViewPager.setOffscreenPageLimit(size);比较好~ 卡顿那个我参考了你们滑动动画的那个试了 效果不行 !我这个不走懒加载的问题比较严重 |
这几处ViewPager相关设置代码发一下 |
刚以相同代码模拟了下,无法复现; 因为你 复现步骤提供下 |
onLazyInitView 触发一次是没有问题 关键是我切换到那个嵌套viewpager的那个fragment 他偶尔不会走这个懒加载方法 再次切换的时候没问题!难道是因为我嵌套的那些fragment view过于复杂吗 ?复现也很难 我也是在偶尔会遇到 |
复现的步骤 无法提供 我尝试很多次找规律 并没有找到 |
嵌套的ViewPager的代码贴下,我回头模拟再查下 |
嵌套的那个就是我以上那条发的代码截图 和mainactivity 的设置一样 ! |
我也是Fragment里面使用ViewPager,然后ViewPager里面加载的是Fragment,然后就会出现第一次进入子Fargment不显示 |
我用的 Fragment 嵌套 Viewpager , 里面放 4 个 Fragment , setOffscreenPageLimit() 设为 3 , 每次进来都会把 4 个 fragment 预加载了 , 每个页面的 onLazyInitView 都在预加载的时候就调用了 , 这样岂不是都没有懒加载的效果了 ? onLazyInitView 懒加载不是在 fragment 可见的时候才调用的吗 ? |
我也是 你解决没有呢 |
Issues Guideline
Following information can help us to resolve the issue faster.
In addition, we do not accept issues unrelated to Fragmentation.
The text was updated successfully, but these errors were encountered: