ViewPager内使用FragmentPagerAdapter时滑动出现illegalstateexception解决办法

来源:互联网 发布:淘宝买浴室柜 编辑:程序博客网 时间:2024/06/11 03:14

ViewPager内使用FragmentPagerAdapter时滑动出现

java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first,

解决办法:

viewpager.setOffscreenPageLimit(6);


要让这个PageLimit的数量大于adapter中的数量。

0 0