Ripple effect does not show up sometimes

后端 未结 2 2052
野的像风
野的像风 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:29

    OK, After some try and error, I have finally get it work.

    First, move the activated state out of ripple node:

    
    
        
            
                
            
        
        
            
                
                    
                        
                    
                
            
        
    
    

    After that, set drawSelectorOnTop to true for the ListView that use the drawable as item background.

    Now the ripple effect can work perfectly.

提交回复
热议问题