0

我在我的 android 应用程序(使用 android 2.2 SDK)中使用 WebView 来使用这个 css 显示一个 html 页面:

body{
background-image: url(.....);
background-size: cover;
background-repeat:no-repeat;
}

我的问题是视图右侧仍然有一个小白条,我想摆脱它。我怎样才能做到这一点?(它在 android 4 上运行良好)

4

2 回答 2

0

最后我找到了一个技巧:

webview.setScrollBarStyle(GONE);

这不会删除滚动条,但会删除后面的白条。如果有人知道更好/更清洁的方法,请告诉我:)

于 2012-05-23T11:59:37.380 回答
0

我相信我有更好的解决方案:

在布局中使用 XML 属性 android:scrollbars="none"。

例子:

<WebView
            android:id="@+id/webView1"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:scrollbars="none" />
于 2013-03-30T03:08:07.100 回答