Search code examples
androidandroid-edittexttextcolor

EditText unable to change the text color


I;m trying to change text color in EditText like this

 <EditText
        android:id="@+id/txtUserName"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_margin="5dp"
        android:gravity="right"
        android:hint="@string/hint_user_name"
        android:textColor="#B49228FF" >

        <requestFocus />
    </EditText>

    <EditText
        android:id="@+id/txtPassword"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_marginTop="50px"
        android:gravity="right"
        android:hint="@string/hint_password"
        android:inputType="textPassword"
        android:textColor="#B49228" />

but it doesn't change this color #B49228 is gold it appears like this enter image description here

My Device : HoneyWell Delphine 70e


Solution

  • Hint doesn't change color. Try typing text, it will work. As the color change is for text that you input. And also your color code is incorrect, has extra FF for first EditText.

    Edited:

    Use the following to change hint color

    android:textColorHint="#FFFFFF"