Ripple effect does not show up sometimes

后端 未结 2 2051
野的像风
野的像风 2021-02-07 07:38

I defined a ripple drawable and set it as the background for the listview item view\'s background. It almost works fine but the ripple effect just sometimes does not show up upo

2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-02-07 08:38

    In my case ripple effect is working after the first click, but for first click it didn't work for me. Have changed the background selector file with android:state_activated="true" and in main.xml android:clickable="true" then it's work fine for all time.

    selector.xml (under res\drawable\selector.xml)

    
    
    
    
    
    
    

    In activity_main.xml

     
    

提交回复
热议问题