简体   繁体   中英

text color for hint in EditText not working

I got this EditText in my Layout file:

 <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. 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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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