如何在 iPhone 上使用活动指示器视图? [英] How to use activity indicator view on iPhone?

查看:28
本文介绍了如何在 iPhone 上使用活动指示器视图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

活动指示器视图在许多应用程序中都很有用.关于如何在 iPhone 上添加、激活和关闭活动指示器视图的任何想法?

An activity indicator view is useful in many applications. Any ideas about how to add, activiate and dismiss an activity indicator view on iPhone?

这里欢迎所有用于此的方法.

All the methods for this are welcomed here.

推荐答案

创建:

spinner = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
[spinner setCenter:CGPointMake(kScreenWidth/2.0, kScreenHeight/2.0)]; // I do this because I'm in landscape mode
[self.view addSubview:spinner]; // spinner is not visible until started

开始:

[spinner startAnimating]; 

停止:

 [spinner stopAnimating];

最终完成后,从视图中移除微调器并释放.

When you're finally done, remove the spinner from the view and release.

这篇关于如何在 iPhone 上使用活动指示器视图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆