Android按钮有时不会在ExpandableListView中更新UI
我正在ExpandableListView的子级中使用按钮。 我已经在按钮的背景中添加了自定义绘图功能,这样就可以在每个状态下显示另一个图像。 它通常显示/更新按钮的背景,但在特定子级中按下按钮时,有时不显示/更新 这是我用来做按钮背景的可画的Android按钮有时不会在ExpandableListView中更新UI,android,user-interface,button,expandablelistview,Android,User Interface,Button,Expandablelistview,我正在ExpandableListView的子级中使用按钮。 我已经在按钮的背景中添加了自定义绘图功能,这样就可以在每个状态下显示另一个图像。 它通常显示/更新按钮的背景,但在特定子级中按下按钮时,有时不显示/更新 这是我用来做按钮背景的可画的 <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_pressed="true" android:d
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" android:drawable="@drawable/button_plus_highlight" />
<item android:state_focused="true" android:drawable="@drawable/button_plus_highlight" />
<item android:drawable="@drawable/button_plus_normal"/>
</selector>
在XML中的ListView上添加此参数
android:descendantFocusability="blocksDescendants"
我希望这有帮助