0

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

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

我使用 IB 来创建活动指标。

谢谢, 吉特什

4

3 回答 3

2

我猜该hidesWhenStopped属性设置为YES,并且活动指示器没有动画。

要么设置hidesWhenStoppedNO(一直显示),要么确保调用:

[self.activityIndicator startAnimating];
于 2012-04-19T11:19:39.057 回答
1

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

activityStyle = UIActivityIndicatorViewStyleWhiteLarge; 
于 2012-04-19T07:13:17.020 回答
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];
于 2012-04-19T11:13:58.487 回答