的EditText无法更改文本颜色 [英] EditText unable to change the text color

查看:152
本文介绍了的EditText无法更改文本颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我,M试图改变文字颜色的EditText这样

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" />

但它不会改变这种颜色#B49228 是它出现这样的金

but it doesn't change this color #B49228 is gold it appears like this

我的设备:霍尼韦尔德尔菲娜70E

推荐答案

提示不变色。尝试输入文本时,它会奏效。作为颜色变化为文本您输入。
而且你的颜色code不正确,有多余的 FF 作为第一次的EditText。

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.

编辑:

使用下面的方法修改颜色提示

Use the following to change hint color

android:textColorHint="#FFFFFF"

这篇关于的EditText无法更改文本颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆