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

猜你喜欢

转载自xuanzhui.iteye.com/blog/2281938