我正在使用iOSSDK最新版本和XCode4.2开发一个iOS4应用程序.
我有一个UIWebView
的XIB,Alpha = 1.0,Background设置为Clear Color,Opaque没有设置.在此XIB上,我使用以下代码设置了一个图像作为背景:
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
UIColor *background = [[UIColor alloc] initWithPatternImage:[UIImage imageNamed:@"AboutBackground.png"]];
self.view.backgroundColor = background;
[background release];
}
return self;
}
UIWebView
显示了一个静态html:
<html><head></head><body style=\"margin:0 auto;text-align:center;background-color: transparent; color:white\">...</body></html>
在iOS 5模拟器上,它的背景是透明的,但在iOS 4设备上是灰色的.
有什么线索吗?