artem
artem

Reputation: 16777

Is it possible to preserve space for error label in TextInputLayout?

I have multiple TextInputLayouts in my layout, and I need to validate fields (and show error text if they are not valid).

But TextView that contains error is added by TextInputLayout dynamically, so it changes layout height and all views at the bottom are moving lower by the height of added TextView.

So the question is: can I preserve space for error text even when error is not showing?

Upvotes: 3

Views: 273

Answers (1)

Suraj Vaishnav
Suraj Vaishnav

Reputation: 8305

In your textInputLayout add this :app:errorEnabled="true"

Upvotes: 7

Related Questions