【问题标题】:UIWEbView transparent background: is possible? [duplicate]UIWEBView 透明背景:可能吗? [复制]
【发布时间】:2012-02-01 16:37:23
【问题描述】:

我有这个 html 页面: 代码:

<html>
<!-- ... -->or explicity set the background-color CSS property to transparent:

<head>
<style type="text/css">
html,
body {
background-color: transparent;
}
</style>

<!-- ... -->
</head>

和一个 uivewbview : 代码:

[webv setBackgroundColor:[UIColor colorWithWhite:1 alpha:0.8]];
[webv loadRequest....];

页面已显示,但背景为白色。 如果我在页面结束之后的开始结束之前滚动页面,我可以看到透明度(页面显示在哪里) 我可以有一个完整的透明 html 页面,这样我就可以看到 uiwebview 的背景了吗? 谢谢

【问题讨论】:

    标签: html uiwebview


    【解决方案1】:

    只需将 webView 的 opaque 属性设置为 NO

    webv.opaque = NO;
    

    【讨论】:

    • 还有:[webv setBackgroundColor:[UIColor clearColor]];
    猜你喜欢
    • 1970-01-01
    • 2014-11-08
    • 1970-01-01
    • 1970-01-01
    • 2014-09-21
    • 1970-01-01
    • 1970-01-01
    • 2012-01-29
    • 2020-10-29
    相关资源
    最近更新 更多