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

내가 코드 이전에 쓴 한 난 allready를 해결 한 밝혀 :

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

내가해야 할 일을했을 모든 그렇게 변경 전 글고 대신 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"); 
}