如何在iPhone中创建透明的Web视图

kin*_*ton 1 xcode objective-c

即时解析一个RSS源并将其加载到webview ..在webview.wat的背景中放置一个图像我想要的是一个透明的webview,它显示图像和解析的内容....下面是code..cud你帮帮我... itemSummary包含解析的feed

[self.itemSummary loadHTMLString:[item objectForKey:@"description"] baseURL:nil];

[self.itemSummary setClipsToBounds:YES];

self.itemSummary.opaque=NO;

self.itemSummary.backgroundColor=[UIColor clearColor];
Run Code Online (Sandbox Code Playgroud)

Ann*_*nne 5

请查看此讨论:https:
//discussions.apple.com/message/9175823?messageID = 9175823&

摘要

使UIWebView透明:

[myWebView setBackgroundColor:[UIColor clearColor]];
[myWebView setOpaque:NO];
Run Code Online (Sandbox Code Playgroud)

使页面本身透明(仅使用一个):

<body style="background-color: transparent">
body{background-color:transparent;}
Run Code Online (Sandbox Code Playgroud)