xamarin android edittext点击弹框

//this.txtIP.Click += TxtIP_Click;//事件

//显示弹框
        //EditText edittext;//对象
        //private void TxtIP_Click(object sender, EventArgs e)
        //{
        //    var dialog = new AlertDialog.Builder(this).SetTitle("请输入").SetIcon(Resource.Drawable.Icon).SetView(edittext = new EditText(this)).SetPositiveButton("确认",
        //      (EventHandler)null).SetNegativeButton("取消", (EventHandler)null).Show();
        //    var no = dialog.GetButton((int)DialogButtonType.Negative);
        //    var yes = dialog.GetButton((int)DialogButtonType.Positive);
        //    no.Click += (sender1, args) =>
        //     {
        //         dialog.Cancel();
        //     };
        //    yes.Click+=(sender2,args2)=>
        //    {
        //        txtIP.Text = edittext.Text.ToString();
        //        dialog.Cancel();
        //    };

        //}

你可能感兴趣的:(xamarin,android)