2016-12-14 49 views
0

我們有這樣的:AlertDialog和形象SetPositiveButton

alertadd.SetPositiveButton("To Close", (senderAlert, args) => 
{ 
Toast.MakeText(this, "Closed", ToastLength.Short).Show(); 
}); 

我們能有SetPositiveButton的形象嗎?我們有SetPositiveButton的「關閉」。

回答

0

您可以將您自己的視圖添加到對話框中,並根據需要設置樣式。例如:

var view = LayoutInflater.Inflate(Resource.Layout.dialog_layout, null); 
var buttonYes = view.FindViewById<Button>(Resource.Id.yesButton); 
var buttonNo = view.FindViewById<Button>(Resource.Id.noButton); 
AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(this); 
      dialogBuilder.SetView(view); 
      var ad = dialogBuilder.Create(); 
      ad.Show();