【发布时间】:2012-06-27 12:34:50
【问题描述】:
在装有 Android 2.3.4 的 HTC Sensation XE 上(也许在其他 HTC 设备上,不幸的是我只能在这个设备上),WebView 的右边框上有一条奇怪的白线(下面的屏幕截图)。我还在具有相同参数的模拟器和华硕 TF101 上测试了我的应用程序,但一切正常。
这个布局在这里发布非常复杂,所以我已经在这个上进行了测试(也有同样的错误):
<?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:background="@color/background"
android:orientation="vertical" >
<!-- This WebView created dynamically -->
<WebView
android:id="@+id/webView"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
</LinearLayout>
And here is the page, that I'm testing on。如您所见,没有填充和边距 (<body style="padding:0; margin:0;">)。
谁能给我一个建议,问题可能出在哪里?谢谢。
【问题讨论】:
-
我也遇到过类似的问题,我怀疑是webView的默认滚动
-
@iNan wow,我该如何隐藏它?
-
可能是这个
webview.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY);你可以试试吗?? -
@sunil 并且不想禁用滚动本身。