就像它本身一樣簡單。我想打一個字母鍵,這將有選擇的繪製是這樣的:有沒有辦法使用XML設置drawable的Alpha?
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Play/Pause -->
<item android:state_selected="false" android:drawable="@drawable/item" />
<item android:state_selected="true" android:drawable="@drawable/item" />
</selector>
我會想要做這樣的事情:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Play/Pause -->
<item android:alpha="125" android:state_selected="false" android:drawable="@drawable/item" />
<item android:alpha="255" android:state_selected="true" android:drawable="@drawable/item" />
</selector>
感謝所有。
我仍然在試圖弄清楚這一點爲好。運氣好的話? – lostintranslation