我在做项目的时候发现webview显示一个html文件的时候,右边总是有一个白色的边框,不太好看,我试了一下好像对我这样水平的还很麻烦,所以来这里请教高手,有什么方法可以吧这个边框去掉。拜托。

解决方案 »

  1.   

    你用的什么layout? 应该是没有你说的白边把 我这样用的merge没啥问题啊<?xml version="1.0" encoding="utf-8"?>
    <merge xmlns:android="http://schemas.android.com/apk/res/android">
    <WebView
            android:layout_width="fill_parent" 
            android:layout_height="fill_parent"
            />
    </merge>
      

  2.   

    不是很清楚你说的是什么白条 你用sdk里面的那个hierarchyviewer看一下你的屏幕是那些view构成的
     或者能传白条的图上来么?  
      

  3.   

     <WebView  
            android:id="@+id/webview" 
            android:layout_width="fill_parent" 
            android:layout_height="fill_parent" 
             android:layout_weight="1"
        /> 
    应该定义个weight
      

  4.   

     <WebView  
            android:id="@+id/webview" 
            android:layout_width="fill_parent" 
            android:layout_height="fill_parent" 
             android:layout_weight="1"
        /> 
      

  5.   

    界面截图点击下面的链接即可获得。http://b50.photo.store.qq.com/http_imgload.cgi?/rurl4_b=a3d0f1ad37738e911d22ede9b78091c0234be96adea1873955c272a08eed3f23d063eaeebee7081f10b8a84992766df7bdeed005322874a2eadde03c92bc5c749cc56eaf498a808d51ac54d794dfed29003aeae8&a=52&b=50
      

  6.   

    http://b50.photo.store.qq.com/http_imgload.cgi?/rurl4_b=a3d0f1ad37738e911d22ede9b78091c0234be96adea1873955c272a08eed3f23d063eaeebee7081f10b8a84992766df7bdeed005322874a2eadde03c92bc5c749cc56eaf498a808d51ac54d794dfed29003aeae8&a=52&b=50
      

  7.   

    http://hi.csdn.net/attachment/201008/26/0_12827974234UXX.gif
     这次应该可以看到了。
      

  8.   

    http://hi.csdn.net/attachment/201008/26/0_12827974234UXX.gif
    这次应该可以看到了。
      

  9.   

    <?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"> <EditText android:id="@+id/EditText01" android:layout_height="wrap_content"
    android:text="http://www.baidu.com" android:layout_width="fill_parent"></EditText> <Button android:text="Go" android:id="@+id/Button01"
    android:layout_width="wrap_content" android:layout_height="wrap_content"></Button> <ProgressBar android:id="@+id/ProgressBar01"
    android:layout_height="wrap_content" android:layout_width="fill_parent"
    style="?android:attr/progressBarStyleHorizontal">
    </ProgressBar> <TextView android:id="@+id/TextView01" android:layout_height="wrap_content"
    android:layout_width="fill_parent" android:text="TextView01"></TextView> <WebView android:id="@+id/webview" android:layout_width="fill_parent"
    android:layout_height="fill_parent" /></LinearLayout>没有发现边框
      

  10.   

    搞定,散分!
    要把滚动条的style设置一下就行了。
      

  11.   

    http://www.eoeandroid.com/thread-689-1-1.html ——请看这里。^_^
      

  12.   

    暂时知道一种解决方法:
    在onCreate里给webView添加一条:
    webView.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);
      

  13.   

    请问楼主,是不是WebView的loadUrl方法不能显示html中的图片?WebView有方法显示本地图文混合的html资源文件?
      

  14.   

    loadUrl可以,loadData不行。本地的html文件使用file:\\\e:\test.html通过loadUrl即可显示。