EditText unable to change the text color

后端 未结 4 422
再見小時候
再見小時候 2021-01-23 09:47

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

 

        
相关标签:
4条回答
  • 2021-01-23 09:54

    Hint color and Text Color are two different thing use this codes create a color.xml file in values folder then add color #B49228 in it like this <color name="myColor">#B49228 </color> and use it like this

     android:textColor="@color/myColor"
    

    and you are using hint text so to change hint color use this code

      android:textColorHint="@color/myColor"
    
    0 讨论(0)
  • 2021-01-23 09:57

    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"
    
    0 讨论(0)
  • 2021-01-23 10:08

    put in color.xml your color like

    <color name="mytextColor">#B49228</color>
    

    and use this

    android:textColor="@color/mytextColor"
    
    0 讨论(0)
  • 2021-01-23 10:12
    android:textColorHint="#FFFFFF"
    

    Please try.

    0 讨论(0)
提交回复
热议问题