首页 新闻 赞助 找找看

安卓5.0的WebView显示页面异常。

0
悬赏园豆:20 [已解决问题] 解决于 2015-11-12 17:25

我是个.NET程序员 帮安卓同事用WebView嵌套一些页面 展示协议之类的东西。

但是字体的显示效果比设置的大许多。

而且有的页面背景色自动显示成了黑色。(我和安卓同事反复确认 他代码里并没有给WebView设置颜色)

 

下面是代码

<!DOCTYPE HTML PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <!--<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0" />
    <meta name="keywords" content="free website templates, Mobile Phone, Mobile Shop Website, HTML CSS" />
    <meta name="description" content="Mobile Shop Websites, Mobile Phones, free CSS website template, Free HTML CSS Layout" />-->
    <meta name="apple-touch-fullscreen" content="yes" />
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
    <meta content="no" name="apple-mobile-web-app-capable" />
    <meta content="black" name="apple-mobile-web-app-status-bar-style" />
    <style>
        * {
            background-color: white;
        }
         img {
             max-width: 100%;
         }

        p {
            color: #000000;
            font-size: 24px;
            text-align: left;
        }
    </style>
</head>
<body style=" margin-left: 34px; margin-right: 34px;">
    <p></p>
    <p style="font-size: 34px;text-align: center;">协议标题</p>
    <p>这是第一行</p>
    <p>这是第二行</p>
    <p>这就是黑背景色的页面</p>
    <div>
        <img src="../image/service_1.png" /></div>
  
</body>
</html>

十分感谢。。

众生皆苦的主页 众生皆苦 | 初学一级 | 园豆:138
提问于:2015-07-09 17:47
< >
分享
最佳答案
0

没设置颜色,默认就是透明的,给WebView设置背景为白色吧。

收获园豆:20
Jeby Sun | 菜鸟二级 |园豆:224 | 2015-07-10 09:03
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册