简体   繁体   中英

Button is not clickable in the Expandable ListView

I have Expandable listview Which contain button, When I click on button the click event is not triggering because button focus is set to false. First I have set button focus false in the xml layout and then based on the existing posts I have changed that and set focusable to false dynamically. But the in the two scenario's button is not clickable. I have tried setting focusable false after setting the onclickListener to the button in the getGroupView method method but the still the button is not click.. Any help Appriciated.

If the button is in the group row then 1. set Focusable true in your xml file for button 2.set focusable to false after setting the onClickListener for the button 3. and the important one is in your grouprow.xml file try to set

android:descendantFocusability="blocksDescendants"

for the View group. This should work.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM