Search code examples
androidhintandroid-design-libraryandroid-textinputlayout

Hint not visible with TextInputLayout on non focus state


I'm using the new TextInputLayout from the Android design library,

When the EditText is focused, everything is okay, and I can see the hint above the EditText:

enter image description here

But when the EditText loses focus, the hint totally disappears:

enter image description here

I expect that the hint will return to the EditText, what am I missing?

xml code below.

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:padding="20dp">

    <android.support.design.widget.TextInputLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content">
        <EditText
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:hint="Try me!"/>
    </android.support.design.widget.TextInputLayout>

    <EditText
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_margin="10dp"
        android:hint="Try me 2"/>
</LinearLayout>

Solution

  • This issue is fixed as of 22.2.1, update your Android SDK.