更改提示EditText的颜色-Android



这里我有我想要的提示的颜色(蓝色),照片nº1,但当我点击它时,它变成了粉红色,照片2。我怎么能把它改成蓝色?我试过更改hintColor,但没有用

<EditText
                android:id="@+id/password"
                android:backgroundTint="@android:color/holo_blue_dark"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:hint="@string/prompt_password"
                android:textColorHint="@android:color/holo_blue_dark"
                android:imeActionId="@+id/login"
                android:imeActionLabel="@string/action_sign_in_short"
                android:imeOptions="actionUnspecified"
                android:inputType="textPassword"
                android:maxLines="1"
                android:singleLine="true" />`

照片1

照片2

对于那些想在评论后知道答案的人。只需将其放在style.xml文件中即可。有很多

<item name="colorAccent">@android:color/holo_blue_dark</item>

您可以尝试使用类似的直接颜色代码

android:textColorHint="#4C33FF"

尝试TextInputLayout:

<android.support.design.widget.TextInputLayout
android:textColorHint="#F7B7C2"
android:layout_width="match_parent"
android:layout_height="match_parent">
<EditText
    android:id="@+id/myid"
    android:textColor="@android:color/black"
    android:hint="something"
    android:layout_width="match_parent"
    android:layout_height="match_parent" />
</android.support.design.widget.TextInputLayout>  

更新:

styles.xml文件中Apptheme中的"colorAccent"更改为需要的颜色

最新更新