Guy*_*Guy 9 xml eclipse android expandablelistview
所以我正在尝试设置一个自定义的ExpandableListView指示器图标,但它无法正常工作.我创建了一个图标并将其保存到drawable文件夹中.这是图标:

这是选择器:
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/arrow_up" android:state_empty="true"/>
<item android:drawable="@drawable/arrow_down" android:state_activated="true"/>
</selector>
Run Code Online (Sandbox Code Playgroud)
ExpandableListView xml:
<ExpandableListView
android:id="@+id/lvExp"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:groupIndicator="@drawable/custom_arrow" />
Run Code Online (Sandbox Code Playgroud)
但是,当我启动应用程序时,根本没有指示器.知道我做错了什么吗?
tyc*_*czj 21
这应该可以解决问题
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_expanded="true" android:drawable="@drawable/arrow_up" />
<item android:drawable="@drawable/arrow_down" />
</selector>
Run Code Online (Sandbox Code Playgroud)
state_expanded当行被扩展时你想要for,然后除了扩展之外的任何其他状态只是正常的向下箭头.但是,您应该处理state_empty什么时候无法扩展到
| 归档时间: |
|
| 查看次数: |
15064 次 |
| 最近记录: |