Android, setting background color of button loses ripple effect

后端 未结 7 1116
北恋
北恋 2020-12-07 00:40

After adding color to an android button, it loses its ripple effect that makes the user feel like there is a responsive click. How do I fix this? I\'ve searched through many

7条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-07 00:49

    You can add the ripple effect & background color with an additionnal ripple drawable:

    your layout :

    
    
    
        

    ripple.xml (this is where you can add background color in addition to the ripple effect) :

    
    
    
    
        
            
                
            
        
    
        
            
                
                
            
        
    
    
    

提交回复
热议问题