Pemba Tamang
Pemba Tamang

Reputation: 464

TextInputLayout label color does not change

I am trying to change the textInputLayout label/hint color. I saw that it follows the colorPrimary so I applied a style in which I set the primary color but it is not working.

My xml-

<com.google.android.material.textfield.TextInputLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_centerInParent="true"
    android:hint="hint"
    style="@style/Text"
    >
    <com.google.android.material.textfield.TextInputEditText
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:id="@+id/edittext"/>
</com.google.android.material.textfield.TextInputLayout>

My style-

<style name="Text" parent="Widget.MaterialComponents.TextInputLayout.OutlinedBox">
        <item name="android:colorPrimary">@color/white</item>
        <item name="boxStrokeColor">@color/white</item>

My layout
enter image description here

Upvotes: 1

Views: 630

Answers (1)

Pemba Tamang
Pemba Tamang

Reputation: 464

The new material libraries are a bit confusing. As of now in com.google.android.material:material:1.1.0-alpha02 the textColorHint is not working but hintTextApperance is working, which has to be a style where the text properties can be defined.

Upvotes: 1

Related Questions