Van*_*nel 141 iphone cocoa-touch objective-c uiwebview ios
我正在使用iOS SDK最新版本和XCode 4.2开发iOS 4应用程序.
我有一个XIB,UIWebView
其中Alpha = 1.0,背景设置为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;
}
Run Code Online (Sandbox Code Playgroud)
在UIWebView
是否显示静态的html:
<html><head></head><body style=\"margin:0 auto;text-align:center;background-color: transparent; color:white\">...</body></html>
Run Code Online (Sandbox Code Playgroud)
在iOS 5模拟器上,它的背景是透明的,但在iOS 4设备上是灰色的.
任何线索?
Mau*_*lik 360
还设置:
[webView setBackgroundColor:[UIColor clearColor]];
[webView setOpaque:NO];
Run Code Online (Sandbox Code Playgroud)
小智 15
/*for ios please set this*/
[webViewFirst setOpaque:NO];
/*for html please set this*/
<body style="background:none">
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
70243 次 |
最近记录: |