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
57
votes
2 answers

Jetpack Compose how to remove EditText/TextField underline and keep cursor?

Hi I need to remove the underline in my TextField because it look ugly when the TextField is circular. I have sat the activeColor to transparent, but then the cursor wont show (because it's transparent). How can I remove the underline/activeColor…
57
votes
7 answers

Outlined Edit Text from Material Design

How can I implement an outlined text field (as shown on this material design page)?
50
votes
31 answers

InflateException when using TextInputLayout

I'm trying to use TextInputEditText from Material Design (https://github.com/material-components/material-components-android/blob/master/docs/components/TextInputLayout.md) and I'm getting runtime exception. This's part of run log: E/AndroidRuntime:…
49
votes
7 answers

TextInputLayout and AutoCompleteTextView

I'm using TextInputLayout in my Android app to achieve that neat floating label effect for my input fields. I know that I should be using the TextInputEditText as well to allow hints to be displayed when in landscape mode and the input are fills the…
47
votes
8 answers

TextField with hint text in jetpack compose

I want to create textfield with hint text in jetpackcompose. Any example how create textfield using jectpack? Thanks
46
votes
8 answers

How to make TextInputLayout hint asterisk red for required fields

Is it possible to make just the asterisk in the hint red when using a TextInputLayout from the design support library? I have seen information on styling the entire hint, but this is a little more complex since only the * should be red, not the…
45
votes
15 answers

Remove underline from TextInputEditText

I have an android screen which takes email from the user. Below is the snippet of the code, I want to remove the underline which appears below the text.
40
votes
10 answers

Change to custom icon from eye-icon(default) for hide-show password in android EditText

I want to change/display different icons for show password in android edittext. I am using following code to display icon.
39
votes
7 answers

Error text in TextInputLayout is covered by keyboard

The TextInputLayout contains an EditText which in turn receives the input from the user. With TextInputLayout introduced with the Android Design Support Library we're supposed to set the error to the TextInputLayout holding the EditText rather than…
38
votes
4 answers

Jetpack Compose: Custom TextField design

In general, most components in Jetpack Compose seem to be very easy to customize. However, the same cannot be said for the TextField. For example, say that I wanted to make something like this: One would think that simply wrapping the BaseTextField…
38
votes
6 answers

How to disable padding on TextInputLayout?

There appears to be left padding automatically added when using a TextInputLayout to wrap an EditText as you can see in the screenshot below. There is no padding added to the EditText in the layout XML, but when the view is rendered there appears…
38
votes
8 answers

Left Icon in TextInputLayout

I'm trying to add an Left Icon to my TextInputLayout, but text get over the Icon. When I add a padding, everything move together. I tried with android:drawableLeft="@drawable/ic_store_white_48dp" android:drawablePadding="50dp" …
Juliatzin
  • 18,455
  • 40
  • 166
  • 325
35
votes
6 answers

Different label and hint for TextInputLayout

I want to make a EditTextLayout, but I want a different text for label and hint. For example : The label's text is "Phone Number", and the hint text is "+6281342134". Is it possible? My code is:
mutokenji
  • 525
  • 1
  • 5
  • 14
34
votes
11 answers

Material design Spinner using TextInputLayout.OutlinedBox styling

I am currently using Material Design TextInputLayout OutlinedBox as shown below:
34
votes
12 answers

Change font of the floating label EditText and TextInputLayout

Someone tried to change the font of the floating label? I changed the source of EditText but the font of the floating label did not change, I am very grateful to those who help me Code:
1
2
3
59 60