尝试创建可扩展的ListView。初始视图中的组显示正常。但是,当我单击列表项时,箭头不会更改。请参见下面的图像。
如何更改箭头方向?
布局XML:
![enter image description here](https://istack.dev59.com/nxBbY.webp)
布局XML:
<ExpandableListView
android:id="@+id/expandable_list"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:divider="@null"
android:background="#ffffff"
android:groupIndicator="@drawable/settings_selector"
android:transcriptMode="alwaysScroll" />
settings_selector.xml:
<?xml version="1.0" encoding="utf-8"?>
<animation-list xmlns:android="http://schemas.android.com/apk/res/android" >
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
<item
android:drawable="@drawable/arrow_down"
android:state_empty="true"/>
<item
android:drawable="@drawable/arrow_right"
android:state_expanded="true"/>
</selector>
</animation-list>