【问题标题】:Strange white border on WebView while testing on HTC Sensation XE在 HTC Sensation XE 上测试时,WebView 上出现奇怪的白色边框
【发布时间】: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。如您所见,没有填充和边距 (&lt;body style="padding:0; margin:0;"&gt;)。

谁能给我一个建议,问题可能出在哪里?谢谢。

【问题讨论】:

  • 我也遇到过类似的问题,我怀疑是webView的默认滚动
  • @iNan wow,我该如何隐藏它?
  • 可能是这个webview.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY);你可以试试吗??
  • @sunil 并且不想禁用滚动本身。

标签: android webview


【解决方案1】:

我想你可以用这个webview.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY); 来隐藏奇怪的滚动条。希望能帮助到你。阅读本文了解更多详情Hiding the scroll bar in WebView

【讨论】:

  • 像魅力一样工作!谢谢
【解决方案2】:

我遇到了这个问题,因为 SCROLLBARS_OUTSIDE_OVERLAY 什么也没做,这让我发疯了。原来是一个盒子阴影!!!!

【讨论】:

    猜你喜欢
    • 2012-03-16
    • 1970-01-01
    • 1970-01-01
    • 2020-11-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多