Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/user-interface/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android按钮有时不会在ExpandableListView中更新UI_Android_User Interface_Button_Expandablelistview - Fatal编程技术网

Android按钮有时不会在ExpandableListView中更新UI

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

我正在ExpandableListView的子级中使用按钮。 我已经在按钮的背景中添加了自定义绘图功能,这样就可以在每个状态下显示另一个图像。 它通常显示/更新按钮的背景,但在特定子级中按下按钮时,有时不显示/更新

这是我用来做按钮背景的可画的

<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"
我希望这有帮助