【发布时间】:2012-06-25 18:49:31
【问题描述】:
我有一个基于Jeff Sharkey's 实现的分段列表视图。问题是仅显示列表视图的一部分(最后一个)。以下是我添加这些部分的方法:
SeparatedListAdapter adapter = new SeparatedListAdapter(this);
for (int i = 0; i < groups.size(); ++i) // groups is an ArrayList<ArrayList<Person>>
{
ArrayList<Person> group = groups.get(i);
adapter.addSection("Section test", new MyCustomAdapter(this, R.layout.custom_cell, group));
}
ListView listView = (ListView) findViewById(R.id.myListView);
listView.setAdapter(adapter);
【问题讨论】:
-
有多少个部分(在真实数据中)?
-
Dheeresh, ++i 和 i++ 在这里具有相同的效果。我已经记录了数组的
size,它们有正确的数据。 8 节,每节 2-5 行。 -
感谢您提供信息............)
-
如果您需要,这里有更多信息:stackoverflow.com/questions/24853/…
-
" 8 个部分,每个部分 2-5 行。"我正在考虑这个信息..
标签: android listview android-widget