3

I want to change TextInputLayout float hint text. Here is the solution I tried:

style.xml:

<style name="TextAppearence.App.TextInputLayout" parent="@android:style/TextAppearance">
    <item name="android:textColor">@color/colorPrimary</item>
</style>

layout.xml:

<android.support.design.widget.TextInputLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:hintTextAppearance="@style/TextAppearence.App.TextInputLayout">

It works fine for some parts of app but not changes the hint color of some activities or fragments. I wonder How is it possible that a piece of code can effect some activities but not on the others.

Any idea?

user5510211
  • 297
  • 1
  • 3
  • 13
  • look there: http://stackoverflow.com/questions/30546430/how-to-change-the-floating-label-color-of-textinputlayout – Ognev Zair Dec 25 '15 at 11:54

2 Answers2

2

Add <item name="colorAccent">@color/theme_color_blue</item> line in your style.xml like this

<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
    <!-- Customize your theme here. -->
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    <item name="colorPrimary">@color/theme_color_blue</item>
    <item name="colorAccent">@color/theme_color_blue</item>
    <item name="android:textColorPrimary">@color/colorTextPrimary</item>
    <item name="android:textColorSecondary">@color/colorTextSecondary</item>
</style>
Anil
  • 1,087
  • 1
  • 11
  • 24
1

you should use textColorHint item for your AppTheme style:

<item name="android:textColorHint">@color/yourcolor</item>
Mahdi Nouri
  • 1,391
  • 14
  • 29