【问题标题】:How to display "More" list item in ListView?如何在 ListView 中显示“更多”列表项?
【发布时间】:2010-08-31 16:12:46
【问题描述】:

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

【问题讨论】:

    标签: android listview listitem listadapter


    【解决方案1】:

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

    【讨论】:

      【解决方案2】:

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

      【讨论】:

        【解决方案3】:

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

        你看过这篇文章了吗?

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

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2013-01-08
          • 1970-01-01
          • 1970-01-01
          • 2017-02-17
          相关资源
          最近更新 更多