如何在ListView中显示“更多”列表项?

时间:2010-08-31 04:36:56

标签: android listview listitem listadapter

我想在ListView的末尾显示一个列表项“More”。单击此列表项将执行某些操作。如何创建这个“更多”列表项?

3 个答案:

答案 0 :(得分:2)

我不知道“点击此列表项会执行某些操作”部分。典型的模式是,一旦用户滚动到底部,就会自动加载新材料。有些人通过检测滚动来做到这一点。我通过放入“更多”占位符并检测何时使用它来实现。 Here is a component that implements this pattern

答案 1 :(得分:1)

只需向arrayadapter(或任何其他适配器)添加另一个值,您可能正在使用。将文本设置为“更多”。 假设您在列表中有n个项目,然后处理第(n + 1)个位置点击并执行您的操作。

答案 2 :(得分:0)

您可以在列表视图中添加页脚...

你看过这篇文章吗?

Android ListView Footer View not being placed on the bottom of the screen