2
editText.setError(message) 
  • расположение Ошибки на EditText влияет Scrollview от прокрутки.

Найдено один открытый вопрос https://code.google.com/p/android/issues/detail?id=52245setError сообщения влияют Scrollview от прокрутки андроида

Но не нашел ни одного решения.

enter image description here

+0

сделал и найти решение этого? –

+0

Нет, я просто меняю фокус с макета во время прокрутки. – abhishek

ответ

3

Я была такая же проблема Aswell. То, что сработало для меня, было называть setError() на элементе TextInputLayout вместо EditText.

Java:

TextInputLayout mEmailInputLayout; 
mEmailInputLayout = (TextInputLayout) findViewById(R.id.emailInputLayout); 
mEmailInputLayout.setError("error Msg"); 

XML:

<!--Email--> 
<android.support.design.widget.TextInputLayout 
    android:id="@+id/emailInputLayout" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content"> 
    <EditText 
     android:id="@+id/email" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:inputType="textEmailAddress"/> 
</android.support.design.widget.TextInputLayout>