我试图在TextInputLayouts上显示验证消息。我应该能够做到这一点(就像本地android一样):
TextInputLayout til = (TextInputLayout) findViewById(R.id.text_input_layout);
til.setErrorEnabled(true);
til.setError("You need to enter a name");
但似乎setError方法不适用于xamarin?对于EditText,setError是可用的,但不希望这样。例如:
TextInputLayout txtI_password
当试图在UI的TextInputLayout上显示错误消息时,我会得到以下错误
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.blablabla.appname, PID: 23691
java.lang.NoSuchFieldError: No field error_color_material of type I in class Landroid/support/v7/appcompat/R$color; or its superclasses (declaration of 'android.supp
最近,我参与了一个使用数据绑定的Android项目。当我尝试创建一个片段单元测试时,它告诉我数据绑定为空。
以下是代码异常跟踪:
java.lang.NullPointerException: Attempt to read from field 'android.support.design.widget.TextInputLayout com.example.android.databinding.AFragmentBinding.textInputMortgagePrice' on a null object reference
下面是我的单元测试代码片段:
public
当我写这段代码时,我想要setError,但是当显示错误信息时,为TextInputLayout设置红色背景TextInputLayout!
I do not want set background!我希望只显示错误信息。
My code:
if (TextUtils.isEmpty(userName)) {
register_UserName_layout.setError("Insert Username");
}
XML代码:
<android.support.design.widget.TextInputLayout
android:id=
有人在用这个吗?我只想问一下,我在一个步骤中有4个以上的Edittexts,每个都有验证方法。我只想知道我应该在我的活动中的哪里调用这些错误捕获方法?
我的验证方法示例如下:
class VerifyAppNameTask extends AsyncTask<String, Void, String> {
// use doInBackground() to make network calls, the returned value is
// sent to onPostExecute()
@Override
protected String