[英]Web browser does not show web pages properly in Windows Phone 8 application
我一直在努力在Windows Phone 8應用程序的Web瀏覽器控件中顯示Web內容。
實際的問題是Web瀏覽器控件未以正確的大小顯示我的網頁(HTML文件)。
以下是顯示我的問題的圖像:
Windows Phone 8 Web瀏覽器控件中顯示的網頁:
其他設備(例如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"> </th>
<th class="lista_view"> </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"> </td>
</tr>
</tbody>
</table>
</div>
</html>
有人可以幫我解決這個問題嗎? 我不知道為什么WP8網絡瀏覽器會這樣顯示我的網頁。
我已經檢查了所有設備的瀏覽器和台式機瀏覽器,而Windows Phone Web瀏覽器是唯一出現此問題的瀏覽器。
注意:
我已經使用諾基亞Lumia 720設備測試了我的應用程序,並且正在使用Microsoft Visual Studio Express 2012 for Windows Phone SDK開發應用程序。
¿可以顯示視口元標記嗎? 嘗試添加到它
target-densitydpi=device-dpi
每部手機都有自己的屏幕分辨率和像素密度,因此您需要使用視口meta才能使其看起來不錯。
如果看不到您的html代碼,我不能說更多。
我從堆棧溢出本身中找到了答案。問題出在我的html。上,我在HTML中添加了視圖端口元標記,ts可以正常工作。
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.