将静态数据添加到使用ListAdapter的动态创建的ListView中
||
我想将X数量的静态行添加到使用ListAdapter / BaseAdapter来动态填充当前ListView的ListView中。有什么建议么?
提前谢谢,科尔。
我的解决方案:根据@Femi \的建议,我最终使用了MergeAdapter。这是我所做的摘要:
// create a new MergeAdapter
MergeAdapter aMergeAdapter = new MergeAdapter();
// add the dynamic content
SkipToListActivityValueAdapter skipToListActivityValueAdapter =
new SkipToListActivityValueAdapter(this, sections);
aMergeAdapter.addAdapter(skipToListActivityValueAdapter);
// add the static content
ArrayAdapter<String> aArrayAdapter =
new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, ADDITIONAL_SKIP_TO_OPTIONS);
aMergeAdapter.addAdapter(aArrayAdapter);
// add the aMergeAdapter to the ListAdapter
setListAdapter(aMergeAdapter);
没有找到相关结果
已邀请:
1 个回复
骂狮淋唐便