2012-03-09 120 views
0

所以我创建了几个HTML页面以通过WebView嵌入到应用程序中,页面本身在正常的Android浏览器中正常工作但是在WebView模块内页面的宽度仅为313,它允许一些水平滚动,这在Android的普通浏览器中不会发生。与Android浏览器宽度相比Webview宽度

所以所需的宽度是320px,WebView正在输出313px但仍允许水平滚动(几个像素)。

下面是我的布局代码,我想Android是在webview中注入一些内联样式,我不知道,想知道是否有人有同样的问题?

<RelativeLayout 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/help_webview" 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent" /> 

</RelativeLayout> 
+0

你可能想看看这里: http://stackoverflow.com/questions/4970045/android-webviews-window-innerwidth-is-coming-313 这为我工作。 – Steelight 2012-06-12 09:45:24

回答