1
我正在創建一個應用程序,它有edittext的幾個變化,當edittext有焦點或沒有焦點時。當視圖具有焦點的顏色應該是藍色的,正常的時候就應該有白色,像這樣:風格EditText下劃線顏色android
我試圖根據這個XML,但創建二九補丁和設置背景似乎不起作用。任何人都可以告訴我如何實現這一目標?
的Xml選擇:
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_enabled="true" android:state_focused="true"
android:drawable="@drawable/spelling_blue" />
<item android:state_window_focused="false" android:state_enabled="true"
android:drawable="@drawable/spelling_white" />
<item android:drawable="@drawable/spelling_white" />
</selector>
感謝
試試這個http://stackoverflow.com/questions/35262935/android-edittext-bottom-line-color-and-theme-changes/35263829#35263829希望這將有助於您。 –
你有什麼資源?你能顯示spelling_blue和spelling_white嗎? – manao
嘗試到 <?xml version =「1.0」encoding =「utf-8」?> –
Alexander