1
방법 SetError에 대한 과부하 :내가 가지 새로운 안드로이드 다음과 같은 문제를 가지고 생각
base.OnCreate(bundle);
var layout = FindViewById<LinearLayout>(Resource.Id.layout1);
Button butondata = FindViewById<Button>(Resource.Id.button3);
Button butonstartdate = FindViewById<Button>(Resource.Id.button4);
Button butonenddate = FindViewById<Button>(Resource.Id.button5);
EditText txtsubiect = FindViewById<EditText>(Resource.Id.editText1);
Button submit = FindViewById<Button>(Resource.Id.buttonsalveaza);
butondata.Click += butondata_Click;
submit.Click += (sender, e) =>
{
txtsubiect.TextChanged += (object sender1, Android.Text.TextChangedEventArgs f) =>
{
if (txtsubiect.Text.Length <= 0)
{
txtsubiect.RequestFocus();
txtsubiect.SetError("Eroare,camp gol!");
}
};
};
내가 그것을 만들 때,이 말한다 : 여기 코드입니다 method'SetError에 대한 과부하 ' 1 개의 인자를 취하고, 무엇이 잘못 되었나요, 혼동스럽고 오류 메시지가 나타날까요? 고마워!
이 Xamarin입니까? EditText.SetError에 대한 설명서를 보셨습니까? – Tim
네, Xamarin입니다. 네, 여기에서 seterror에 대한 문서를 읽었습니다 : http://developer.android.com/reference/android/widget/EditText.html –
Xamarin의 문서에 따르면,'SetError'는 'Android.Widget.TextView.SetError' 두 개의 오버로드가 있는데 둘 다 두 개의 인수를 가지며'SetError (Java.Lang.ICharSequence, Android.Graphics.Drawables.Drawable)'와'SetError (string, Android.Graphics.Drawables.Drawable)' – Tim