本文整理汇总了C#中Android.Widget.TextView.ClearFocus方法的典型用法代码示例。如果您正苦于以下问题:C# TextView.ClearFocus方法的具体用法?C# TextView.ClearFocus怎么用?C# TextView.ClearFocus使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Android.Widget.TextView
的用法示例。
在下文中一共展示了TextView.ClearFocus方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnCreateView
public override View OnCreateView(LayoutInflater inflater, ViewGroup container,Bundle savedInstanceState)
{
base.OnCreateView (inflater, container, savedInstanceState);
var view = inflater.Inflate (Resource.Layout.LogInDialog, container, false);
mTxtUserName = view.FindViewById<EditText> (Resource.Id.txtUserName);
mTxtPassword = view.FindViewById<EditText> (Resource.Id.txtPassword);
mCheckbox = view.FindViewById<CheckBox> (Resource.Id.LoginCheckBox);
try{
var CheckPrefs = Application.Context.GetSharedPreferences("MyCheckState", FileCreationMode.Private);
checkState = CheckPrefs.GetString("CheckState", null);
}catch{
}
switch (checkState)
{
case "False":
mCheckbox.Checked = false;
break;
case "True":
mCheckbox.Checked = true;
try{
var UsernamePrefs = Application.Context.GetSharedPreferences("username", FileCreationMode.Private);
mTxtUserName.Text = UsernamePrefs.GetString("username", null);
}catch{
}
try{
var PasswordPrefs = Application.Context.GetSharedPreferences("password", FileCreationMode.Private);
mTxtPassword.Text = PasswordPrefs.GetString("password", null);
}catch{
}
break;
default:
mCheckbox.Checked = true;
break;
}
mBtnSignUp = view.FindViewById<Button> (Resource.Id.btnLogInDialog);
mErrorText = view.FindViewById<TextView> (Resource.Id.txtError);
mProgressBar = view.FindViewById<ProgressBar> (Resource.Id.progressBar);
mProgressBar.Visibility = ViewStates.Invisible;
mBtnSignUp.Click += (object sender, EventArgs e) => {
mProgressBar.Visibility = ViewStates.Visible;
mTxtUserName.ClearFocus();
mErrorText.ClearFocus();
mBtnSignUp.RequestFocus();
mErrorText.Text=string.Format("登录中...");
//关键盘
InputMethodManager inputManager = (InputMethodManager)Activity.GetSystemService(Context.InputMethodService);
inputManager.HideSoftInputFromWindow(mTxtPassword.WindowToken, HideSoftInputFlags.None);
inputManager.HideSoftInputFromWindow(mTxtUserName.WindowToken, HideSoftInputFlags.None);
mWorker=new BackgroundWorker();
mWorker.WorkerSupportsCancellation = true;
mWorker.DoWork+= delegate(object sender1, DoWorkEventArgs e1) {
BackgroundWorker mworker = sender1 as BackgroundWorker;
if (mworker.CancellationPending == true) {
e1.Cancel = true;
} else {
checkPassword();
}
};
mWorker.RunWorkerCompleted+=delegate(object sender1, RunWorkerCompletedEventArgs e1) {
if (e1.Cancelled == true) {
} else if (!(e1.Error == null)) {
} else {
worker_RunWorkerCompleted();
}
};
if (mWorker.IsBusy != true) {
mWorker.RunWorkerAsync ();
}
//.........这里部分代码省略.........