2

我尝试使用以下代码创建活动指示器

    CGRect frame = CGRectMake(160, 160.0,40.0,40.0);
progressIndicator = [[[UIActivityIndicatorView alloc] initWithFrame:frame]autorelease];
[progressIndicator startAnimating];
progressIndicator.activityIndicatorViewStyle = UIActivityIndicatorViewStyleWhiteLarge;
progressIndicator.hidesWhenStopped=YES;
[progressIndicator sizeToFit];
[self.view addSubview:progressIndicator];

此代码在除 iphone 4 之外的所有设备中都能正常工作(即指示器未在 iphone 4 中显示)。出于这个原因,我被迫将 UIActivityIndi​​catorViewStyleWhiteLarge 更改为 UIActivityIndi​​catorViewStyleGray 以便在所有设备中显示活动指示器。谁能解释我为什么会这样?

4

3 回答 3

4

The large white indicator has no drop shadow on ios 4 like it does on ios 3. I'm not sure why apple removed the shadow, but the indicator is there. You just can't see it on a white background anymore. Use the grey one, or put a background behind it.

于 2011-01-13T02:39:03.507 回答
1

在 iOS 4 发布一周后,我开了一张反对票,甚至还没有收到对该问题的确认。它适用于 iOS < 4,在 iOS >= 4 中损坏。怀疑它会很快得到修复。

于 2011-02-08T00:22:07.843 回答
0

嗨,我和你有同样的问题,但是实际上显示了指标。这似乎是硬件问题。我猜视网膜显示器无法在白色背景下正确显示白色显示器。因为当指示器显示在黑色背景上时,我可以检查它是否有效。我希望它可以帮助你

于 2010-11-18T02:52:03.973 回答