今天遇到多个Fragment切换,回来后页面空白的情况,找到这个博客方法设置了一下,就可以了
- vpAdapter = new VpAdapter(getSupportFragmentManager(), fragments);
- vp_content.setAdapter(vpAdapter);
- vp_content.setOffscreenPageLimit(2);//设置ViewPage缓存界面数
本文共 208 字,大约阅读时间需要 1 分钟。
转载地址:http://kjnbl.baihongyu.com/