本文整理汇总了C#中UIActivityIndicatorView.RemoveFromSuperview方法的典型用法代码示例。如果您正苦于以下问题:C# UIActivityIndicatorView.RemoveFromSuperview方法的具体用法?C# UIActivityIndicatorView.RemoveFromSuperview怎么用?C# UIActivityIndicatorView.RemoveFromSuperview使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UIActivityIndicatorView
的用法示例。
在下文中一共展示了UIActivityIndicatorView.RemoveFromSuperview方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoadUrl
public static async Task LoadUrl(this UIImageView imageView, string url)
{
if (string.IsNullOrEmpty (url))
return;
var progress = new UIActivityIndicatorView (UIActivityIndicatorViewStyle.WhiteLarge)
{
Center = new PointF(imageView.Bounds.GetMidX(), imageView.Bounds.GetMidY()),
};
imageView.AddSubview (progress);
var t = FileCache.Download (url);
if (t.IsCompleted) {
imageView.Image = UIImage.FromFile(t.Result);
progress.RemoveFromSuperview ();
return;
}
progress.StartAnimating ();
var image = UIImage.FromFile(await t);
UIView.Animate (.3,
() => imageView.Image = image,
() => {
progress.StopAnimating ();
progress.RemoveFromSuperview ();
});
}
示例2: SetImage
public async void SetImage (string url)
{
UIImage image = null;
if (!images.ContainsKey(url)) {
var spinner = new UIActivityIndicatorView (UIActivityIndicatorViewStyle.Gray);
spinner.StartAnimating();
spinner.Center = new CGPoint (PhotoView.Frame.Width / 2f, PhotoView.Frame.Height / 2f);
ContentView.AddSubview(spinner);
var imageData = await ResourceLoader.DefaultLoader.GetImageData(url);
image = UIImage.LoadFromData(NSData.FromArray(imageData));
spinner.StopAnimating();
spinner.RemoveFromSuperview();
images.Add(url, image);
} else {
image = images[url];
}
PhotoView.ContentMode = UIViewContentMode.ScaleAspectFill;
PhotoView.Image = image;
}
示例3: RemoveSpinner
void RemoveSpinner (UITableViewCell cell, UIActivityIndicatorView spinner)
{
spinner.StopAnimating ();
spinner.RemoveFromSuperview ();
cell.Accessory = UITableViewCellAccessory.DisclosureIndicator;
}