我有一个基于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 ++在这里有相同的效果。我记录了数组的大小,并且他们有正确的数据。 8节,每节2-5行。 – jmosesman
感谢您提供的信息........... :) –