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來解決它,將會非常感激! –