Android ViewPager 中加载 Fragmenet的几种方式
1、当fragment里面的内容较少时,可以利用加载view 的方法来进行:
private List<View> viewList;
//在onCreate方法里面添加
viewList = new ArrayList<View>();
View view1 = View.inflate(this, R.layout.view1, null);
View view2 = View.inflate(this, R.layout.view2, null);
View view3 = View.inflate(this, R.layout.view3, null);
View view4 = View.inflate(this, R.layout.view4, null);
viewList.add(view1);
viewList.add(view2);
viewList.add(view3);
viewList.add(view4);
本博客地址: wukong1688
本文原文地址:https://www.cnblogs.com/wukong1688/p/10692055.html
转载请著名出处!谢谢~~