tags:

views:

310

answers:

3

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");

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

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>

Any suggestions??

A: 

This may not be the "best" answer but it worked for me.

<WebView android:layout_marginRight="-7dip" />

Let me know if there is something better because this feels hackish to me.

Aaron T Harris
A: 

I would set margin: 0 and padding: 0 inside the . You could do something like

<body style="margin: 0; padding: 0">
Jonah
+7  A: 

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

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

Chris Danielson
that solved it for me, much appreciated!
rusvdw