How to make button with custom background image show click animation in Android

前端 未结 5 1461
無奈伤痛
無奈伤痛 2020-12-05 16:27

How to make button show it is clicked (by setting it go down/some change) for buttons using custom background image in Android. I do not want to include more images and set

5条回答
  •  抹茶落季
    2020-12-05 16:59

    You can create a simple transparent black image, and create a level-list drawable by which u can place the transparent image over the actual image. This gives an effect of pushing it down. You can further use this as an onclick image as shown below.

    
        
    
        
            
            
            
            
        
    
    
    
    

提交回复
热议问题