【问题标题】:9 Patch showing strange background in Lollipop9 补丁在棒棒糖中显示奇怪的背景
【发布时间】:2015-07-11 10:50:30
【问题描述】:

我最近刚刚更新到 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"/>

【问题讨论】:

标签: android android-5.0-lollipop nine-patch android-5.1.1-lollipop


【解决方案1】:

将此添加到您的布局中的Button 以消除这种影响。

android:stateListAnimator="@null"

希望对您有所帮助。

【讨论】:

  • 谢谢,但如果您能解释为什么显示背景以及将 stateListAnimator 设置为 null 如何解决它,我们将不胜感激!
猜你喜欢
  • 1970-01-01
  • 2015-08-14
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-09-13
  • 1970-01-01
  • 2015-06-27
  • 2016-04-03
相关资源
最近更新 更多