0
我有一個ImageView,我想讓它可點擊來按下它並更改圖像。我用下面的:ImageVIew與狀態爲棒棒糖版本不起作用?
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_enabled="true" android:drawable="@drawable/back"/>
<item android:state_pressed="true" android:drawable="@drawable/back_pressed"/>
</selector>
上SrcCompat我把上面的,但沒有..
我如何使用XML選擇做呢?
「對於棒棒糖版本無法正常工作」....和較低的API? – Opiatefuchs
並且您需要爲默認狀態或錯誤狀態添加drawable ... – Opiatefuchs