【问题标题】:android expandableListView - add items to a specific group at run timeandroid expandableListView - 在运行时将项目添加到特定组
【发布时间】:2011-04-21 02:30:50
【问题描述】:

我遇到了一个问题,我有一个 expandableListView 有 5 个组

如果我想向第二组添加一些项目,并在运行时更新 expandableListView,

有人可以教我怎么做吗?

【问题讨论】:

    标签: android cursor adapter expandablelistview


    【解决方案1】:

    更新生成 ExpandableListView 的光标/适配器并自动重新生成视图

    【讨论】:

    • 我确实更新了适配器,但是 expandablelistView 没有更新.......是我忘记了什么吗?
    【解决方案2】:

    如果您使用的是 BaseExpandableListAdapter,那么您可以在运行时获取 getChildView (...),您可以在其中添加您想要的任何内容。如果您仍然遇到任何问题,请详细说明您想要做什么,

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-05-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-04-22
      • 1970-01-01
      相关资源
      最近更新 更多