【发布时间】:2011-05-29 17:34:19
【问题描述】:
对于下面的 html,我预计绿色矩形只会占据屏幕的一半,但实际上它占据了整个屏幕宽度。我尝试了视口宽度的其他值,但没有运气。任何想法为什么它不起作用?
HTML
<html>
<head>
<meta name="viewport" content="width=640" />
</head>
<body>
<div style="width: 300px; height: 50px; background: green;">300px</div>
<div style="width: 600px; height: 50px; background: yellow;">600px</div>
</body>
</html>
Xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
>
<WebView
android:id="@+id/web_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
</LinearLayout>
【问题讨论】:
-
@vnshetty。不,我没有答案。
标签: android webview width viewport