【发布时间】:2013-01-31 06:51:47
【问题描述】:
我如何在视图加载之前添加UIActivityIndicatorView。我正在从 网络服务器 获取数据。
这是我的代码
spinner=[[UIActivityIndicatorView alloc]initWithFrame:CGRectMake(225, 115, 30, 30)];
[spinner setBackgroundColor:[UIColor clearColor]];
[spinner setActivityIndicatorViewStyle:UIActivityIndicatorViewStyleGray];
[self.view addSubview:spinner];
[spinner startAnimating];
objCountryPreferences=[[CountryPreferences alloc]init];
objLanguagePreference=[[LanguagePreference alloc]init];
objMobilePrefixParser=[[MobilePrefixParser alloc]init];
//这是调用不同的网络服务
[objMobilePrefixParser getMobilePrefix];
[objLanguagePreference languagePreference];
[objCountryPreferences getCountryIdArr];
【问题讨论】:
-
你遇到了什么问题?
-
对不起,我不能,这里不欢迎这种评论。它可以是标志,或者您的问题可以被否决。
-
我想在加载视图时添加活动指示器。并在从 Web 服务获取数据后停止。你能建议我做什么吗?
-
你是如何通过 NSURLConnection 或简单的 NSData 加载数据的?
-
我正在从 NSURLConnection 加载数据。
标签: iphone ios objective-c ios6.1