如何使UIWebview透明.

Wol*_*ine 2 iphone uiwebview

我有一个带有Alpha = 1.0的UIWebView的XIB,背景设置为Clear Color,而Opaque未设置.在这个XIB上,我使用以下代码将图像设置为背景:

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)

任何方案?

kus*_*hah 5

试试这个...

webViewFirstTab.opaque=NO;

for (UIView* subView in [webViewFirstTab subviews])
{
    if ([subView isKindOfClass:[UIScrollView class]]) {
        for (UIView* shadowView in [subView subviews])
        {
            if ([shadowView isKindOfClass:[UIImageView class]]) {
                [shadowView setHidden:YES];
            }
        }
    }
}
Run Code Online (Sandbox Code Playgroud)