其他分享
首页 > 其他分享> > android – 9补丁在棒棒糖中显示奇怪的背景

android – 9补丁在棒棒糖中显示奇怪的背景

作者:互联网

我刚刚更新到api 22,我们的九个补丁按钮开始显示一些奇怪的行为.按钮后面出现了另一个按钮或某种边框,并在选择按钮时进行了一种提升动画.

我指的是你在按钮右端看到的白色部分.

这是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"/>

解决方法:

将其添加到布局中的Button以消除该效果.

android:stateListAnimator="@null"

希望它有所帮助.

标签:android,android-5-0-lollipop,android-5-1-1-lollipop,nine-patch
来源: https://codeday.me/bug/20190702/1359085.html