xcode 活动指示器视图
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3426989/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Activity indicator view
提问by Daniel Kivatinos
How does the activity indicator view work?
活动指示器视图如何工作?
Can you just drag and drop this on a screen?
你能把它拖放到屏幕上吗?
回答by conmulligan
Do you mean a UIActivityIndicatorViewor the status bar activity indicator?
你的意思是UIActivityIndicatorView还是状态栏活动指示器?
If you want to use a UIActivityIndicatorView
, create one in code or IB and control it using [activityView startAnimating]
and [activityView stopAnimating]
. To use the status bar activity indicator, you can show and hide it like this:
如果您想使用 a UIActivityIndicatorView
,请在代码或 IB 中创建一个并使用[activityView startAnimating]
and控制它[activityView stopAnimating]
。要使用状态栏活动指示器,您可以像这样显示和隐藏它:
[UIApplication sharedApplication].networkActivityIndicatorVisible = YES;
// do your network stuff
[UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
回答by madusanka
xode 4.5.1 add activity view controller simply drag and drop in to the view after that click on activity view controller then control+drag to the .h file set appropriate name next in the .m we can sysnthesize it and start using [activityview startAnimating] we can use hide when we need to display set activityview.hidden=True ifnot set as False
xode 4.5.1 添加活动视图控制器只需拖放到视图中,然后单击活动视图控制器然后控制+拖动到 .h 文件,然后在 .m 中设置适当的名称,我们可以对其进行合成并开始使用 [activityview startAnimating ] 我们可以在需要显示时使用hide set activityview.hidden=True ifnot set as False