Questions tagged [android-textinputlayout]

Layout which wraps an EditText (or descendant) to show a floating label when the hint is hidden due to the user inputting text.

Layout which wraps an EditText (or descendant) to show a floating label when the hint is hidden due to the user inputting text. Also supports showing an error via setErrorEnabled(boolean) and setError(CharSequence).

887 questions
231
votes
26 answers

How to change the floating label color of TextInputLayout

With reference to the new TextInputLayout released by Google, how do I change the floating label text color? Setting colorControlNormal, colorControlActivated, colorControlHighLight in styles does not help. This is what I have now:
143
votes
16 answers

how to change color of TextinputLayout's label and edittext underline android

I am using android design library's TextinputLayout. But couldn't customize the hint color, label color and the underline color of EditText inside TextinputLayout. Please help.
Nitesh Verma
  • 2,460
  • 4
  • 20
  • 36
113
votes
11 answers

Disable/Remove floating label hint text in TextInputLayout XML

This may seem counter-intuitive but is there a way to disable or remove the floating label hint in TextInputLayout? The reason I want to use TextInputLayout instead of just an EditText is for the counter that TextInputLayout provides. Here is what I…
Micro
  • 10,303
  • 14
  • 82
  • 120
105
votes
8 answers

Android 8.0 Oreo crash on focusing TextInputEditText

After updating some of our devices to android 8.0 , upon focusing on a TextInputEditText field inside of a TextInputLayout, the app crashes with this Exception: Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method…
102
votes
18 answers

Change the TextInputLayout outline color

I'm trying to customize a TextInputLayout with material style. I managed to set the focused state to the colors I want: Using
Addev
  • 31,819
  • 51
  • 183
  • 302
101
votes
5 answers

EditText added is not a TextInputEditText. Please switch to using that class instead

I'm using an EditText inside a TextInputLayout, but after upgrading the support library to 23.2.0, I get this warning in the logcat, What's the difference between a regular EditText and a TextInputEditText? I can't seem to find any documentation for…
99
votes
9 answers

How to set TextInputLayout error message colour?

How can I change the colour of the error message that can be set to appear below the text field in a TextInputLayout (via setError(...) – see error state here)? It normally shows as a red colour, which I want to change. Which item names/keys should…
Seb Jachec
  • 3,003
  • 2
  • 30
  • 56
90
votes
10 answers

How to add floating label on Spinner

After using the Android Design Support Library's TextInputLayout to place a floating label above an EditText component, I was wondering if there is a way to add a floating label to the Spinner component (not necessarily using the Design Library). By…
80
votes
4 answers

Couldn't resolve resource @id/visible when using TextInputLayout

Couldn't resolve resource @id/visible when using TextInputLayout on appcompat-v7:25.x.x Tried these steps below, but the problem is still persist: Rebuild Project Clean and Rebuild Project Clear Cache and Restart Android Studio Below is the code…
FanFM
  • 941
  • 1
  • 7
  • 12
77
votes
6 answers
76
votes
1 answer

TextInputLayout has no effect for giving hint programmatically in EditText

I have an EditText and it's parent is TextInputLayout. I am trying to give hint programmatically for EditText, (not in layout) in this case Text input hint animation is not working, it's working like simple EditText. can some one suggest how to…
prGD
  • 1,501
  • 2
  • 12
  • 22
75
votes
10 answers

TextInputLayout.setError() leaves empty space after clearing the error

I recently used TextInputLayout and it's setError() method. The problem I'm getting is, when I clear the error by calling setError(null) it leaves so much of empty space at the bottom. Normal: With error: After clearing error: After looking at…
Mangesh
  • 5,491
  • 5
  • 48
  • 71
71
votes
20 answers

TextInputLayout :How to give padding or margin to hint?

I have to use TextInputLayout of design support library in my project. I want to give space between hint and EditText in TextInputLayout. I set margin and padding in TextInputLayout and even inside EditText but both are not work.So how to solve this…
66
votes
3 answers

Toggle password field jetpack compose

Hi I am trying to change visualTransformation dynamically when the user click on see password button. I can manage to filter password but couldn't achive to show in plain text. Any idea for that ? Here is what I got so far. fun UserInputText( …
60
votes
4 answers

Issue: change border color or box stroke for unfocused TextInputLayout in android

I have a very specific issue for changing the outline of the textbox for TextInputLayout when it's unfocused. I can't seem to find an attribute to change the color for the border of my "unfocused" text box. Here's a visual example of what I'm trying…
1
2 3
59 60