【问题标题】:Web browser does not show web pages properly in Windows Phone 8 applicationWeb 浏览器无法在 Windows Phone 8 应用程序中正确显示网页
【发布时间】:2014-12-31 22:22:00
【问题描述】:

我一直在努力在 Windows Phone 8 应用程序的 Web 浏览器控件中显示 Web 内容。

实际的问题是网络浏览器控件没有以正确的大小显示我的网页(HTML 文件)。

以下是显示我的问题的图片:

在 Windows Phone 8 网络浏览器控件中显示的网页:

其他设备,如 Android 手机、iPhone 和 iPod 以及其他设备正确显示我的网页,如下所示:

我的 HTML 像这样,

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
     <html xmlns="http://www.w3.org/1999/xhtml">
     <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Highest Runs 2013</title>
    <link rel="stylesheet" type="text/css" href="css/orange.css">
    </head>
    <body bgcolor="#A31947">
         <div class="contenedor">
         <table align="center">
        <tbody>
        <tr>
        <td colspan="10" class="lista_view">Highest  Runs 2014</td>
        </tr>
          <tr>
            <th class="lista_view">&nbsp;</th>
            <th class="lista_view">&nbsp;</th>
            <th class="lista_view"><strong>
              <bold>Player Name</bold>
            </strong></th>
            <th class="lista_view">Runs*</th>
            <th class="lista_view">M</th>
            <th class="lista_view">HS</th>
            <th class="lista_view">100</th>
            <th class="lista_view">50</th>
            <th class="lista_view">4s</th>
            <th class="lista_view">6s</th>
          </tr>
                  <tr><td colspan="10" class="lista_view">&nbsp;</td>
          </tr>
        </tbody>
      </table>
      </div>
    </html>

有人可以帮我解决这个问题吗?我不知道为什么 WP8 网络浏览器会这样显示我的网页。

我检查了所有设备的浏览器和桌面浏览器,Windows Phone 网络浏览器是唯一存在此问题的浏览器。

注意:

我已经在诺基亚 Lumia 720 设备上测试了我的应用程序,并且我正在使用 Microsoft Visual Studio Express 2012 for Windows Phone SDK 开发应用程序。

【问题讨论】:

    标签: c# html windows-phone-8 webbrowser-control


    【解决方案1】:

    ¿你能显示你的视口元标记吗?尝试添加它

    target-densitydpi=device-dpi
    

    每部手机都有自己的屏幕分辨率和像素密度,因此您需要使用视口元数据来使其看起来不错。

    没有看到你的 html 代码,我不能说更多。

    【讨论】:

    • 感谢您的回复丹尼尔。刚才我已经添加了我的 HTML 代码。请查看并尝试标记我出错的地方。,
    【解决方案2】:

    我从堆栈溢出本身找到了答案。问题出在我的 html 上。我在我的 HTML 中添加了查看端口元标记,并且 ts 工作正常。像这样。,

       <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-05-30
      • 2023-03-03
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多