Reputation: 2811
When i call EditText.setError(); the error appears below the edittext, and makes it impossible to interact with the View below the EditText. Is it possible to show the error above the EditText? Google doesn't seem to have the answer(Or i'm using wrong search terms).
Upvotes: 15
Views: 3874
Reputation: 3633
For this you have to take one textview with custom background above the 1st edittext and align_parent_right=true. Rather than setting setError() to edittext set the visibility(visible/invisible) to the textview. For that red drawable placed at right side in edittext, u can set drawableRight to edittext with setCompoundDrawablesWithIntrinsicBounds() method.
Upvotes: 0
Reputation: 371
The Crouton Library seems to be a better way to display errors when validating forms. See some reasons here
Upvotes: 1