简体   繁体   English

EditText中提示的文本颜色不起作用

[英]text color for hint in EditText not working

I got this EditText in my Layout file: 我在布局文件中得到了这个EditText

 <EditText
        android:id="@+id/EditTextFtpIp"
        android:hint="www.example.com"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textColor="#000000"
        android:textColorHint="#D3D3D3"
        android:ems="10" />

I set the textColorHint to light gray. 我将textColorHint设置为浅灰色。 Unfortunality that has absolutly no effect in my emulator. 不幸对我的模拟器完全没有影响。 The hint color is always white. 提示颜色始终为白色。

what did I wrong? 我怎么了

my minSdkVersion is 12. targetSdk 21. 我的minSdkVersion是12。targetSdk 21。

Regards Stefan 问候斯蒂芬

Absolutely should work, try again with this 绝对可以,请再试一次

   <EditText
        android:id="@+id/edit_text"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:ems="10"
        android:hint="text"
        android:textColorHint="#ff2851" />

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM