【问题标题】:Adding a imageview to child elements in a expandable list query向可扩展列表查询中的子元素添加图像视图
【发布时间】:2010-04-22 11:59:58
【问题描述】:

我正在寻找如何将图像分配给可扩展列表的每个子项中的图像视图。

如果有人有任何信息或链接来了解如何做到这一点,我将不胜感激。

expListAdapter =
            new SimpleExpandableListAdapter( 
                main.this,
                createGroupList(),
                R.layout.parentnode,
                new String[] { "day", "number" },
                new int[] { R.id.TextView01, R.id.TextView02 },
                createChildList(),
                R.layout.child_row,
                new String[] { "image", "childName", "date"},
                new int[] { R.id.ImageView01, R.id.childname, R.id.date }
            );
        setListAdapter( expListAdapter );

这是我的适配器目前的​​样子,我在自定义适配器方面的经验很少,所以我不知道从哪里开始。

任何帮助都会很棒:D

【问题讨论】:

    标签: android android-widget expandablelistview


    【解决方案1】:

    您需要扩展 Adapter 类并覆盖 getView 方法。 在其中,您可以使用光标查询的结果修改任何字段。

    【讨论】:

      猜你喜欢
      • 2014-01-24
      • 1970-01-01
      • 2011-08-03
      • 1970-01-01
      • 1970-01-01
      • 2012-10-24
      • 2015-04-11
      • 2021-03-21
      • 1970-01-01
      相关资源
      最近更新 更多