I'm developing an iOS 4 application using iOS SDK latest version and XCode 4.2.
I have a XIB with a UIWebView
with Alpha = 1.0, Background set to Clear Color and Opaque is not set. On this XIB I setup an image as background with this code:
- (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;
}
The UIWebView
is showing an static html:
<html><head></head><body style="margin:0 auto;text-align:center;background-color: transparent; color:white">...</body></html>
On iOS 5 simulator, its background is transparent, but on an iOS 4 device is grey.
Any clue?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…