【发布时间】:2011-08-16 17:37:43
【问题描述】:
我想在自定义 ExpandableListView 中完全隐藏 groupIndicator。
here 提供的示例似乎不起作用。
它建议制作一个选择器并使用我复制的 expList.setGroupIndicator(selector):
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/empty_icon">
<item android:state_empty="true" android:drawable="@android:color/transparent"/>
<item android:state_expanded="true" android:drawable="@android:color/transparent" />
<item android:drawable="@android:color/transparent" />
</selector>
这会产生以下错误ERROR/AndroidRuntime(10675): Caused by: android.content.res.Resources$NotFoundException: Resource is not a Drawable (color or path): TypedValue{t=0x12/d=0x0 a=2 r=0x7f0b0013}
使用 android:id/empty 代替 color/transparent 的类似建议给出了同样的建议。
我怎样才能完全隐藏组指示器?
编辑:事实证明,该代码确实有效...如果您将其放在可绘制资源文件夹而不是布局中。
【问题讨论】:
标签: android expandablelistview