TextInputLayout Hint doesn't float up after updating Google Support Library

≡放荡痞女 提交于 2019-11-27 05:28:10

You must provide hint to the TextInputLayout and use TextInputEditText instead of EditText

<android.support.design.widget.TextInputLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:hint="From">

    <android.support.v7.widget.TextInputEditText
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="09:00 AM" />
</android.support.design.widget.TextInputLayout>
Mahmood Abudaqa

After updating to version 25.1.0 of the v7 appcompat library, I faced many serious bugs in Toolbar, RecyclerView, etc.

I went back to version 25.0.1.

UPDATE: The issue was fixed in 25.3.1

It is a bug in 25.1.0 https://code.google.com/p/android/issues/detail?id=230171 It seems we have to use previous 25.0.1 version for now.

@Rahul Sharma,

Why you are using android:hint="From" and android:text="09:00 AM" in EditText tag of xml file?

Instead of that you can use only android:hint="From in xml file and In Java code u can set text in dynamically.

I hope u will get my point. Thanks.

This issue is fixed in Support Library Version 25.2.0. Please update to 25.2.0 This update includes other major fixes.

https://developer.android.com/topic/libraries/support-library/revisions.html#25-2-0

Check your Do changes like this in you build.gradle for dependencies .. I think gradle is not a problem

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.1.1'
    compile 'com.android.support:design:24.1.1'

}

If not solve by changes of gradle change First check basic changes in you inpul layout .. it will defiantly do your text float.. after do your changes.

 <android.support.design.widget.TextInputLayout
                    android:id="@+id/til1"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:focusableInTouchMode="true"
                    android:layout_margin="10dp">


    <EditText
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:hint="From"
        android:inputType="time"
        android:text="09:00 AM"
        android:id="@+id/from_mon"
        android:textSize="14sp" />

                </android.support.design.widget.TextInputLayout>

NOTE: And if possible set your hint in to string file .. may that will also be the issue.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!