本文整理汇总了C#中Android.App.ProgressDialog.SetIcon方法的典型用法代码示例。如果您正苦于以下问题:C# ProgressDialog.SetIcon方法的具体用法?C# ProgressDialog.SetIcon怎么用?C# ProgressDialog.SetIcon使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Android.App.ProgressDialog
的用法示例。
在下文中一共展示了ProgressDialog.SetIcon方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnCreate
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
SetContentView(Resource.Layout.Main);
Button start = FindViewById<Button>(Resource.Id.startButton);
Button stop = FindViewById<Button>(Resource.Id.stopButton);
ProgressDialog pd = new ProgressDialog(this)
{
Indeterminate = true,
};
pd.SetMessage("Waiting");
pd.SetButton("cancel", (s, e) => Stop(pd));
pd.SetIcon(Resource.Drawable.Icon);
//pd.SetCancelable(false);
Drawable myIcon = Resources.GetDrawable(Resource.Animation.progress_dialog_icon_drawable_animation);
pd.SetIndeterminateDrawable(myIcon);
start.Click += delegate { Start(pd); };
stop.Click += delegate { Stop(pd); };
}
示例2: DownloadingProgressDialog
public ProgressDialog DownloadingProgressDialog(string title, string message)
{
ProgressDialog progress = new ProgressDialog(context);
progress.SetMessage(message);
progress.SetTitle(title);
progress.SetIcon(Resource.Drawable.Icon);
progress.SetButton("Cancel", (sender, args) =>
{
// Close progress dialog
progress.Dismiss();
// Stop all downloads
client.CancelAsync();
// Remove any language folders that were to be downloaded
for (var i = 0; i < downloadQueue.Count; i++)
{
DeleteLanguagePack(downloadQueue[i]);
}
// No downloads to be downloaded
downloadQueue = new List<string>();
// No files to be download
FilesCoutner = 0;
// They didn't all download, but set to true anyways
allDownloaded = true;
if (DownloadedLanguages.Count > 0)
{
Language = Language;
}
});
progress.SetProgressStyle(ProgressDialogStyle.Horizontal);
progress.SetCancelable(false);
progress.SetCanceledOnTouchOutside(false);
return progress;
}