With reference to the new TextInputLayout
released by Google, how do I change the floating label text color?
Setting colorControlNormal
, colorControlActivated
, colorControlHighLight
in styles does not help.
This is what I have now:
With reference to the new TextInputLayout
released by Google, how do I change the floating label text color?
Setting colorControlNormal
, colorControlActivated
, colorControlHighLight
in styles does not help.
This is what I have now:
In my case I added this "
app:hintTextAppearance="@color/colorPrimaryDark"
in my TextInputLayout widget.I suggest you make style theme for TextInputLayout and change only accent color. Set parent to your app base theme:
Now, simply using
colorAccent
andcolorPrimary
will work perfectly.I tried using android:textColorHint in the android.support.design.widget.TextInputLayout it works fine.
Ok, so, I found this answer very helpful and thanks to all the people who contributed. Just to add something, though. The accepted answer is indeed the correct answer...BUT...in my case, I was looking to implement the error message below the
EditText
widget withapp:errorEnabled="true"
and this single line made my life difficult. it seems that this overrides the theme I chose forandroid.support.design.widget.TextInputLayout
, which has a different text color defined byandroid:textColorPrimary
.In the end I took to applying a text color directly to the
EditText
widget. My code looks something like this:styles.xml
And my widget:
Now it displays black text color instead of the
textColorPrimary
white.