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
SlidingTabLayout之动态添加删除tab #129
Comments
这是我在demo,新加的代码进行测试 动态添加删除的XML
JAVA数据源修改
监听
adapter
SimpleCardFragment新增此方法
|
我也是, 添加删除直接报空指针异常 |
这个问题解决了吗 |
各位解决上述问题了吗?我试了一下,添加或删除tab后重新设置以下可以暂时可用: |
@ContinueCoding
|
@ContinueCoding
|
@guominfang 这个问题好纠结啊,我按照新的方法也不行呢 |
1.作者默认的PagerAdapter继承了FragmentPagerAdapter,自己写一个PageAdapter继承FragmentStatePagerAdapter。
即可解决。 FragmentPagerAdapter FragmentPagerAdapter拥有自己的缓存策略,当和ViewPager配合使用的时候,会缓存当前Fragment以及左边一个、右边一个,一共三个Fragment对象。 另外CommonTabLayout如果想动态刷新,通过反射将mIsFirstDraw设为true,然后set数据即可:
|
@kailaisi 你的解决不了?
|
1、更新fragment集合 SlidingTabActivity 动态更新所有数据源
修改 这样就可以动态更新所有数据源,不知道存在其他问题没有 |
动态添加tab时,并且滑动到新添加的tab页demo会报错
The text was updated successfully, but these errors were encountered: