Android L ripple touch effect on shape?

前端 未结 4 1612
抹茶落季
抹茶落季 2020-12-04 19:25

I have a rounded rectangle with elevation that casts a shadow, just like in the example here: http://developer.android.com/preview/material/views-shadows.html#shadows

<
4条回答
  •  星月不相逢
    2020-12-04 19:57

    click here for complete source code

    Create button.xml in drawable folder

    
        
        
    
    

    Create button.xml in drawable-v21 folder

    
        
    
    

    you can set button.xml as background of your view.

    
    

    if you want custom color for ripple effect instead of default gray, then you can archive it by adding colorControlHighlight in your style.

    
    
        
        
    
    
    

提交回复
热议问题