基本上,我想在EditText属性focusable
和foucsableInTouchMode
设置为false时更改提示的颜色。android中的hinttext颜色选择器
这与textColor
一切都很好,但与Editext的textColorHint
财产无用。
我尽我最大的努力,但所有的静脉,所以我的代码如下
我已创建了一个名为“colorListfile”表述如下绘制,
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:state_window_focused="false"
android:state_enabled="true"
android:color="@color/colorPrimaryDark" />
<item
android:state_window_focused="false"
android:state_enabled="false"
android:color="@color/white" />
<item
android:state_focused="true"
android:color="@color/login_signup_header_textcolor" />
<item
android:color="@color/colorPrimary" />
</selector>
我的EditText如下图所示,
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="zuluzulu01"
android:textColorHint="@drawable/colorListfile"
android:hint="Name" />
但是这个或任何其他方法没有奏效。但是,如果此属性设置为textColor
,则此代码正常工作。
任何帮助将不胜感激。
可以将'color'更改为'drawable',例如像'<项 机器人:state_focused = “真” 机器人:抽拉= “@颜色/ login_signup_header_textcolor”/>' –
@周恩旭,由于哥们,但这也行不通 –