Android: TextInputLayout hides drawableRight for child EditText

I am always updating with library updates, and this is what it led to.

In build.gradle (Project: xxx):

classpath 'com.android.tools.build:gradle:2.2.0-beta1' 

In build.gradle (Module: app)

 compile 'com.android.support:appcompat-v7:24.2.0' compile 'com.android.support:design:24.2.0' 

And enter the password field as below:

 <android.support.design.widget.TextInputLayout android:layout_width="match_parent" android:layout_height="wrap_content"> <android.support.v7.widget.AppCompatEditText android:layout_width="match_parent" android:layout_height="wrap_content" android:inputType="textPassword" /> </android.support.design.widget.TextInputLayout> 

Taadaa ... The My Passwords field now looks like this:

enter image description here

You can also just select EditText .

But there are some glitches in this update.

Problem: If I put any drawableRight in an EditText, it will not display anything. TextInputLayout also has the ability to disable the switch function. I did it the same way as shown below, but without success:

 <android.support.design.widget.TextInputLayout android:layout_width="match_parent" android:layout_height="wrap_content" app:passwordToggleEnabled="false"> <EditText android:layout_width="match_parent" android:layout_height="wrap_content" android:drawableRight="@drawable/ic_alarm_on_black_24dp" android:inputType="textPassword" /> </android.support.design.widget.TextInputLayout> 

Can anybody help me.

+8
android android-edittext android-design-library android-textinputlayout
source share
2 answers

I reported an error at https://code.google.com/p/android/issues/detail?id=221002 .

It was a bug in the library version 24.2.0 , but it was fixed in version 24.2.1 . Just update as below:

 compile 'com.android.support:appcompat-v7:24.2.1' compile 'com.android.support:design:24.2.1' 
+3
source share

You need to update the support library to 24.2.1 (see https://code.google.com/p/android/issues/detail?id=221002 ).

-one
source share

All Articles