0
mTextInputLayout.seterror(null);
mTextInputLayout.setErrorEnabled(false);
如何设置错误或修正设置边境后删除默认的TextInputLayout Android应用程序
mTextInputLayout.seterror(null);
mTextInputLayout.setErrorEnabled(false);
如何设置错误或修正设置边境后删除默认的TextInputLayout Android应用程序
要TextInputLayout
设置错误,你必须给该
例如,
<LinearLayout
android:id="@+id/login_userbar"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<android.support.design.widget.TextInputLayout
android:id="@+id/username_text_input_layout"
style="@style/TextLabel"
android:layout_width="match_parent"
android:layout_height="match_parent">
<EditText
android:id="@+id/etUsername"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</android.support.design.widget.TextInputLayout>
</LinearLayout>
如果您尝试验证EditText字段,请尝试向您的EditText字段添加TextWatcher。
对于实例
mText.addTextChangedListener(new TextWatcher(){
public void afterTextChanged(Editable edt){
if(mText.getText().length() > 7){
mText.setError("The input should be grater than 7 characters long");
}else{
mText.setError(null);
}
}
}
按照Android开发者文档,SETERROR(空)应该工作以清除错误。欲了解更多信息Click Here。
@Vinod Ranga不是你的问题解决? –