Android Viewpager加Fragment做界面切换时数据消失的解决方式
时间:2018-06-01 16:11:51
收藏:0
阅读:428
今天遇到多个Fragment切换,回来后页面空白的情况,找到这个博客方法设置了一下,就可以了
- vpAdapter = new VpAdapter(getSupportFragmentManager(), fragments);
- vp_content.setAdapter(vpAdapter);
- vp_content.setOffscreenPageLimit(2);//设置ViewPage缓存界面数
原文:https://www.cnblogs.com/xgjblog/p/9122068.html
评论(0)