Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TextInputLayout error text padding

I am using TextInputLayout with AppCompatEditText having a custom xml shape based background for AppCompatEditText. Whenever i set some error , the error line starts from beginning of layout. Is there any way to give padding to that error line.

enter image description here

like image 838
BST Kaal Avatar asked Jan 21 '16 07:01

BST Kaal


People also ask

How do I remove TextInputLayout padding?

By default, some space is reserved for assistive labels below SfTextInputLayout control. These reserved spaces can be removed by setting ReserveSpaceForAssistiveLabels property as false when helper and error text are empty and ShowCharCount is false.

What is TextInputLayout?

Android App Development for Beginners Before getting into example, we should know what is TextInputLayout in android. TextInputLayout is extended by Linear Layout. It going to act as a wrapper for edit text and shows flatting hint animation for edit text.


1 Answers

You can reference error TextView by using:

TextView textView = (TextView) inputLayout.findViewById(android.support.design.R.id
            .textinput_error);

Then you can get its layout params to work with.

like image 131
Boris Kozyrev Avatar answered Oct 13 '22 15:10

Boris Kozyrev