當我嘗試在機器人瀏覽器加載以下HTML頁面,圖像不重施膠根據如何根據不同的分辨率調整android webview中的圖像大小?
<html>
<header>
<meta name="viewport"
content="width=device-width,initial-scale=1.0, maximum-scale=1.0, target-densityDpi=device-dpi" />
<link rel="stylesheet" href="file:///android_asset/style.css"
type="text/css">
</header>
<body>
<p>This is a sample.</p>
<br />
<p>This is a sample. this is a sample to test text alignment This is a sample. this is a sample to test text alignment This is a sample. this is a sample to test text alignment This is a sample. this is a sample to test text alignment This is a sample. this is a sample to test text alignment This is a sample. this is a sample to test text alignment This is a sample. this is a sample to test text alignment This is a sample. this is a sample to test text alignment This is a sample. this is a sample to test text alignment This is a sample. this is a sample to test text alignment This is a sample. this is a sample to test text alignment This is a sample. this is a sample to test text alignment </p>
<br />
<img align="center" class="centeraligned"
src="file:///mnt/sdcard/Android/data/com.sample.sample/sample.jpg"
height="600" width="630" />
<br />
</body>
</html>
分辨率如果設置了視口內容寬度= 600倍的圖像看起來很好。但文字與左邊對齊。 我在視口中缺少任何設置嗎?
P.S:僅在Kindle Fire HD和Kindle Fire Classic中出現文本對齊問題。
我確實有應該不會佔據設備全寬的小圖像。 – Ads 2013-03-27 09:34:42
怎麼樣一些百分比,然後像50%或東西 – 2013-03-27 09:35:15
設置寬度=「50%」使圖像拉伸,因爲高度仍然是固定的 – Ads 2013-03-27 09:44:41