web视图显示在右侧的白条 [英] webview showing white bar on right side

查看:319
本文介绍了web视图显示在右侧的白条的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我给下面的方法调用我的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);

这篇关于web视图显示在右侧的白条的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆