【发布时间】:2012-08-30 22:07:38
【问题描述】:
所以我的应用由两个ListFragments 组成。让我们称他们为ContentsList 和TextList。问题是当我像这样向ContentsList 的ListView 添加页脚时(在onActivityCreated() 方法中:
lv = getListView();
v = getActivity().getLayoutInflater().inflate(R.layout.add_new,
null);
lv.addFooterView(v);
它也会自动为TextList ListView 的列表视图添加页脚。知道为什么会发生这种情况吗?
【问题讨论】:
-
我们可以看看你的 getListView() 方法吗?我假设他们在同一个活动上?
-
看,这个getListView()是一个ListFragment的标准方法。我的每个片段都扩展了这个 ListFragment。这就是问题第一部分的答案。
-
尽管它确实是同一个活动——它是不同的片段和不同的 ListView。这是肯定的
标签: android android-listview android-fragments android-listfragment