4

我刚刚更新到api 22,我们的九个补丁按钮已开始显示一些奇怪的行为。在按钮后面出现了另一个按钮或某种边框,并在按钮被选中时进行一种提升动画。9修补程序在棒棒糖中显示奇怪的背景

Unselected button Selected button

我指的是该位为你的按钮的右端看到白色部分。

这是xml。

<selector xmlns:android="http://schemas.android.com/apk/res/android"> 
<item android:state_enabled="false" android:drawable="@drawable/arrow_gray_button"/> 
<item android:state_pressed="false" android:state_enabled="true" android:drawable="@drawable/arrow_orange_button"/> 
<item android:state_pressed="true" android:state_enabled="true" android:drawable="@drawable/arrow_orange_button_pressed"/> 

+1

可能与http://stackoverflow.com/questions/28737164/9patch-on-lollipop-not-working-as-expected?rq=1 – user2864740

回答

2

在布局添加到您的Button摆脱这种效果。

android:stateListAnimator="@null" 

希望它有帮助。

+0

工作!谢谢。 –

+0

谢谢,但是如果你能解释为什么后台显示以及如何将stateListAnimator设置为null来解决它,将会非常感激! –