2017-03-29 7 views
0

TextInputLayout内のEditTextに別のエラーメッセージを設定する際に問題が発生しました。TextInputLayoutのデフォルトエラーポップアップ

enter image description here

私が欲しいもの:

enter image description here

はTextInputLayoutを維持しながら、それを達成するために、とにかくはありますか?私は何を得る

+0

郵便あなたのコードのXMLとJava – Noorul

+0

あなたがeditText.setError( "エラーの説明")を使用することができます@marekxy。 –

+0

intrestに感謝しますが、それを解決するために管理して、私は忘れてしまった私は前にTextInputLayoutのエラーを設定し、私は必要なすべてをEditTextでエラーを設定する – marekxy

答えて

0

私は出回っそれを解決しているが判明し、私は、コード内で前に書いている:私がしなければならなかった

((TextInputLayout) item_).setError(valid.getEventResult().getViewErrors()[i].getMessage().get_Message()); 

すべては私がのEditTextの代わりTextInputLayoutにエラーを設定して、それを変更しました。

0

XML:

<TextInputLayout 
    android:layout_height="wrap_content" 
    android:layout_width="match_parent"> 

    <EditText 
      android:id="@+id/et" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content"/> 

</TextInputLayout> 

JAVA:

EditText et = (EditText) findViewById(R.id.et); 
if(et.getText().length() == 0){ 
    et.setError("Please Enter this Detail"); 
} 
関連する問題