TextInputLayout Hint does not update after updating Google Support Library

I recently updated my support library to com.android.support:appcompat-v7:25.1.0 , after which if I add text to EditText via an xml file, the TextInputLayout hint will not pop up.

I also considered this question , but it did not work for me.

Here is my xml code:

 <android.support.design.widget.TextInputLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="16dp" app:layout_constraintTop_toTopOf="parent" app:layout_constraintBottom_toBottomOf="parent" android:layout_marginBottom="16dp" android:layout_marginEnd="16dp" app:layout_constraintRight_toRightOf="parent" android:layout_marginRight="16dp" app:layout_constraintVertical_bias="0.0" android:id="@+id/til1" android:layout_marginStart="16dp" app:layout_constraintLeft_toLeftOf="parent" android:layout_marginLeft="16dp" app:layout_constraintHorizontal_bias="0.33"> <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> 

Here are my gradle dependencies:

 dependencies { compile fileTree(include: ['*.jar'], dir: 'libs') androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { exclude group: 'com.android.support', module: 'support-annotations' }) compile 'com.android.support:appcompat-v7:25.1.0' compile 'com.android.support.constraint:constraint-layout:1.0.0-beta4' compile 'uk.co.chrisjenx:calligraphy:2.2.0' compile 'com.android.support:design:25.1.0' compile 'com.android.support:support-v4:25.1.0' compile 'com.android.support:recyclerview-v7:25.1.0' compile 'com.android.support:cardview-v7:25.1.0' compile 'com.android.volley:volley:1.0.0' compile 'com.github.bhargavms:DotLoader:1.0.1' compile 'com.github.bumptech.glide:glide:3.7.0' compile 'de.hdodenhof:circleimageview:2.1.0' compile 'com.labo.kaji:fragmentanimations:0.1.1' compile 'com.github.esafirm.android-image-picker:imagepicker:1.2.5' testCompile 'junit:junit:4.12' } 

This is problem

enter image description here

You can clearly see a tooltip pop up.

Please guide.

+6
source share
6 answers

You should specify the TextInputLayout hint 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> 
+9
source

After upgrading to version 25.1.0 of the appcompat v7 library, I encountered many serious errors in Toolbar , RecyclerView , etc.

I returned to version 25.0.1.

+4
source

UPDATE: The problem has been fixed in 25.3.1.

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

+3
source

@ Rahul Sharma,

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

Instead, you can only use android:hint="From in the xml file, and in Java code you can dynamically set the text.

I hope you have my point of view. Thanks.

+1
source

This issue has been fixed in Support Library Version 25.2.0. Update to 25.2.0 This update contains other major fixes.

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

+1
source

Check your Do changes like this; 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 you don’t solve the changes, gradle change First check the main changes in your inpul layout .. it will defiantly make your text float .. after making 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 on the string file .. maybe this will also be a problem.

-2
source

Source: https://habr.com/ru/post/1013142/


All Articles