【问题标题】:webView hiding content in swiftwebView在swift中隐藏内容
【发布时间】:2015-05-14 17:56:32
【问题描述】:

我已经创建了一个 100% 宽度的 html 模板,但它似乎仍然在屏幕右侧隐藏了内容。假设模板使用 webView 嵌入到 ios 应用程序中。您可以在下面看到它的外观:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8" />
    <style type="text/css">
        body{
            font-family: 'PT Sans';
            margin-left:0;
            margin-right:0;
            margin-top: 0;
            width   100%;
        }
        .title_div{
            padding-left:5px;
            padding-right:5px;
            font-size:16px;
            width: 100%;
            word-wrap: break-word;

        }

    .title_div p {
         display: block;
    }
    h3{
        font-size: 26px;
        padding-left:5px;
        word-wrap: break-word;
          margin-top: 5px;
    }
    .main_image {
        width: 100%;
        height: 200px;
        background-size: cover;
    }
    .main_image img{
        width: auto;
        height: auto;

    }
    </style>
</head>
<body>

   <div class="main_image" style="background-image:url([[[main_image]]])" title="[[[alt_desc]]]"></div>
   <h3>[[[title]]]</h3>
   <div class="title_div">
        <p>[[[full_text]]]</p>
   </div>
</body>
</html>

【问题讨论】:

    标签: html ios css webview


    【解决方案1】:

    尝试将 webviews scalesPageToFit 属性设置为 YES!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多