Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/33.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
背景大小css属性不为';不能很好地使用android WebView_Android_Css_Android Webview - Fatal编程技术网

背景大小css属性不为';不能很好地使用android WebView

背景大小css属性不为';不能很好地使用android WebView,android,css,android-webview,Android,Css,Android Webview,我在android应用程序(使用android 2.2 SDK)中使用WebView来显示使用以下css的html页面: body{ background-image: url(.....); background-size: cover; background-repeat:no-repeat; } 我的问题是,视图右侧仍然有一个小白条,我想去掉它。我该怎么做?(它在android 4上运行良好)最后我找到了一个窍门: webview.setScrollBarStyle(GONE); 这不

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

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

我的问题是,视图右侧仍然有一个小白条,我想去掉它。我该怎么做?(它在android 4上运行良好)

最后我找到了一个窍门:

webview.setScrollBarStyle(GONE);

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

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

在布局中使用XML属性android:scrollbars=“none”

例如:

<WebView
            android:id="@+id/webView1"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:scrollbars="none" />