List item with button not clickable anymore

后端 未结 6 1276
再見小時候
再見小時候 2021-02-02 12:23

I have a list item with a button inside.

When the button is shown, the list item is not clickable anymore. To make it clickable again, I have replaced the button with a

6条回答
  •  天涯浪人
    2021-02-02 13:02

    You can create an xml file that contains the clicked behavior of the view. Create an xml file, custom_button.xml (or whatever you want to call it) and fill it with this code:

    
    
    
        
        
        
        
        
        
        
        
        
        
    
    
    

    You can then change the

    android:color=""
    

    To

    android:drawable=""
    

    And assign them to any drawable resources you have in your drawable folder. Then in the xml file for your layout containing the view, add:

    android:background="custom_button"
    

提交回复
热议问题