UIActivityIndi​​cator没有出现在iOS 5中

时间:2012-04-19 06:56:27

标签: iphone ipad ios5 ios4 uiactivityindicatorview

我在我的应用中成功实现了活动指示器,在模拟器和设备上也正常工作。最近我将我的设备操作系统从4升级到5.因为我看不到早先出现的活动指示器。

我的模拟器仅支持OS 4.2,并且它正确显示活动指示器。在设备上它没有显示可能是因为OS 5.

我使用IB创建活动指标。

谢谢, Jitesh

3 个答案:

答案 0 :(得分:2)

我猜测hidesWhenStopped属性设置为YES,活动指标不是动画。

hidesWhenStopped设置为NO(以便始终显示),或确保致电:

[self.activityIndicator startAnimating];

答案 1 :(得分:1)

只需检查样式属性,在某些情况下,白色和灰色不起作用,就像在ios 5中一样,下面的样式对我来说是可行的。

activityStyle = UIActivityIndicatorViewStyleWhiteLarge; 

答案 2 :(得分:0)

希望这会奏效---

UIActivityIndicatorView *activityIndicator; //declare it as globaly

   CGFloat width = 40;
    CGFloat height = 40;
    CGRect centeredFrame = CGRectMake(500, 150, width, height);
    activityIndicator = [[UIActivityIndicatorView alloc] initWithFrame:centeredFrame];
    activityIndicator.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.5];
    [self.view addSubview:activityIndicator];
相关问题