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