Android5按钮阴影

Android 5 (Lollipop) 版本的按钮自带阴影,部分场合比较难看,取消阴影的方法

 

Lollipop has a nasty little feature called  stateListAnimator  which handles the elevations on Buttons, which leads to shadows.

 

Remove the stateListAnimator to get rid of the shadows.

 

You have got multiple options to do that:

 

In code:

button.setStateListAnimator(null);

 

or in your layout xml's:

<Button
...
android:stateListAnimator="@null" 
....
/> 

 

 

refer

How to remove border/shadow from lollipop buttons

 

 

你可能感兴趣的:(Lollipop)