0
我正在使用導航抽屜(使用導航抽屜活動)在Android工作室和它的工作正常。如何更改android導航抽屜中所選項目的背景顏色?
但我想更改抽屜項目列表中選定項目的背景顏色。我想將默認顏色更改爲我的自定義顏色。
任何想法???
我正在使用導航抽屜(使用導航抽屜活動)在Android工作室和它的工作正常。如何更改android導航抽屜中所選項目的背景顏色?
但我想更改抽屜項目列表中選定項目的背景顏色。我想將默認顏色更改爲我的自定義顏色。
任何想法???
在res⇒可繪製的名爲list_item_bg_pressed.xml下創建另一個xml佈局,其中包含以下內容。
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle"><gradient
android:startColor="@color/list_background_pressed"
android:endColor="@color/list_background_pressed"
android:angle="90" />
創建選擇
<item android:drawable="@drawable/list_item_bg_normal" android:state_activated="false"/>
<item android:drawable="@drawable/list_item_bg_pressed" android:state_pressed="true"/>
<item android:drawable="@drawable/list_item_bg_pressed" android:state_activated="true"/>
欲瞭解更多信息請參閱此鏈接Sliding drawer
@ Vishal..i試過你的答案,但它不適合我。 –
@DHAKAD嘗試鏈接其工作完美的親愛的。 –
感謝@Vishal你解決了我的問題 –