ホームページ  >  記事  >  バックエンド開発  >  C# は Xamarin を使用してアプリケーションを開発する -- アラート ボックス

C# は Xamarin を使用してアプリケーションを開発する -- アラート ボックス

黄舟
黄舟オリジナル
2017-03-01 10:36:571361ブラウズ


public static class AlertExtension
	{
		public static void ShowAlert(this Activity activity ,string msg,string title = "", string btnText = "OK"){
			AlertDialog.Builder builder = new AlertDialog.Builder(activity);
			builder.SetTitle(title);
			builder.SetMessage(msg);
			builder.SetCancelable(false);
			builder.SetPositiveButton(btnText, delegate {
					// it is alert ,keep it simple , do nothing here 
				});
			builder.Show();
		}
	}

Huancuan敤镞讹丝

if(txtPwd.Text != txtCfmPwd.Text){
					this.ShowAlert("Password and confirmed password not match");
				}

上記は、Xamarin を使用してアプリケーションを開発するための C# の内容です - Alert Box の詳細については、PHP 中国語 Web サイト (www.php.ん)!


声明:
この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。