我如何UIActivityIndicatorView
在视图加载之前添加一个。我正在从Web 服务器获取数据。
这是我的代码
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];
//这是调用不同的Web服务
[objMobilePrefixParser getMobilePrefix];
[objLanguagePreference languagePreference];
[objCountryPreferences getCountryIdArr];