我正在使用iOS SDK最新版本和XCode 4.2开发一个iOS 4应用程序。
我有一个带有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设备上是灰色的。
有什么线索吗?
https://stackoverflow.com/questions/8667150
复制相似问题