1 、问题
viewpage加载第3个fragment的时候,第一个fragment又重新构建问题,感觉自己好傻逼的,不知道啥原因,原来是少了一个设置,加载旁边多少个fragment不销毁
2 、解决办法
viewPager.offscreenPageLimit = 3
3、推荐滑动页面万能的指示器框架
https://github.com/hackware1993/MagicIndicator
4、部分代码实现如下
布局文件
<LinearLayoutandroid:layout_marginTop="@dimen/common_10dp"android:layout_width="match_parent"android:layout_height="match_parent"