Android AlertDialog Single Button

后端 未结 9 1699
陌清茗
陌清茗 2020-12-12 12:08

I\'d like to have an AlertDialog builder that only has one button that says OK or Done or something, instead of the default yes and no. Can that be done with the standard Al

9条回答
  •  臣服心动
    2020-12-12 12:17

    In Mono for Android you can do this:

    var ad = new AlertDialog.Builder(this);
    ad.SetTitle("Title");
    ad.SetMessage("Message");
    ad.SetPositiveButton("OK", delegate { ad.Dispose(); });
    ad.Show();
    

提交回复
热议问题