Android WebView可以';t在某些手机上显示html表格的右边框

Android WebView可以';t在某些手机上显示html表格的右边框,android,android-webview,Android,Android Webview,我的XML文件中有一个WebView,如下所示: <WebView android:id="@+id/webView" android:layout_width="match_parent" android:layout_height="match_parent"/> 截图: 单向 并将添加的@JavascriptInterface mWebView.getSettings().setDomStorageEnabled(true); 另一种方式 换成这个

我的XML文件中有一个WebView,如下所示:

<WebView
    android:id="@+id/webView"
    android:layout_width="match_parent"
    android:layout_height="match_parent"/>
截图:


单向

并将添加的
@JavascriptInterface

mWebView.getSettings().setDomStorageEnabled(true);
另一种方式

换成这个

<WebView android:id="@+id/webView" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:scrollbars="none"/>
添加
@JavascriptInterface

@JavascriptInterface
public static void loadUrl(WebView webView, String url) {
   // do something here
}
你可以检查一下。


您应该尝试使用类似于ScrollView的webview

<ScrollView
        android:layout_width="fill_parent" 
        android:layout_height="match_parent" 
        android:id="@+id/scroll">
      <WebView
         android:id="@+id/webView"
         android:layout_width="match_parent"
         android:layout_height="match_parent"
         android:layout_margin="0dp"
         android:padding="0dp"/>
</ScrollView>


我希望这能对你有所帮助。

试试
我试过了,但都不管用。是的,我两个都试过了,但还是不管用。不管怎样,我想得到你的帮助。顺便问一下,添加@JavascriptInterface是什么意思,我需要把它放在哪里?是的,它可以添加下面的代码,但它似乎加载了一个pc网站,它不适合手机屏幕。mWebView.getSettings().setUseWideViewPort(true);谢谢你的帮助,这并不能解决这个问题。
@JavascriptInterface
public static void loadUrl(WebView webView, String url) {
   // do something here
}
<ScrollView
        android:layout_width="fill_parent" 
        android:layout_height="match_parent" 
        android:id="@+id/scroll">
      <WebView
         android:id="@+id/webView"
         android:layout_width="match_parent"
         android:layout_height="match_parent"
         android:layout_margin="0dp"
         android:padding="0dp"/>
</ScrollView>