web视图显示在右侧的白条白条、视图、web

由网友(听西园夜雨)分享简介:我给下面的方法调用我的WebView客户端嵌在我的布局wv.loadData(< HTML><车身BGCOLOR = \黑\>< / BODY>< / HTML>中,text / html的,UTF-8 ); I am giving the following met...

我给下面的方法调用我的WebView客户端嵌在我的布局 wv.loadData(< HTML><车身BGCOLOR = 黑>< / BODY>< / HTML>中,text / html的,UTF-8 );

I am giving the following method call to my webview client embedded in my layout wv.loadData("<html><body bgcolor="Black"></body></html>","text/html", "utf-8");

在我这运行在设备上,它显示在右边白色的竖线。我固定的白色的东西用 webview.setBackgroundColor(Color.BLACK); ,但我想彻底删除

when i run this on the device, it shows a white vertical bar on the right side. I fixed the white thing by using webview.setBackgroundColor(Color.BLACK); but i want to remove it completely

以下是我的布局XML

Following is my layout xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >
<TextView  
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:text="@string/hello"
    />
    <WebView android:id="@+id/wv1"
            android:layout_height="fill_parent"
            android:layout_width="fill_parent"
            />

</LinearLayout>

任何建议?

推荐答案

使用下面的隐藏,但不会删除滚动条的功能。布局保证金调整是一个讨厌的解决方法。

Use the following to hide but not remove the functionality of the scrollbar. The layout margin adjustment is a nasty work-around.

// web视图是你的WebView对象的引用。 webview.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY);

//webview being your WebView object reference. webview.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY);

阅读全文

相关推荐

最新文章