android中webview显示html文件的时候右边的边框有办法去掉吗? 我在做项目的时候发现webview显示一个html文件的时候,右边总是有一个白色的边框,不太好看,我试了一下好像对我这样水平的还很麻烦,所以来这里请教高手,有什么方法可以吧这个边框去掉。拜托。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 你用的什么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> 不是很清楚你说的是什么白条 你用sdk里面的那个hierarchyviewer看一下你的屏幕是那些view构成的 或者能传白条的图上来么? <WebView android:id="@+id/webview" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1" /> 应该定义个weight <WebView android:id="@+id/webview" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1" /> 界面截图点击下面的链接即可获得。http://b50.photo.store.qq.com/http_imgload.cgi?/rurl4_b=a3d0f1ad37738e911d22ede9b78091c0234be96adea1873955c272a08eed3f23d063eaeebee7081f10b8a84992766df7bdeed005322874a2eadde03c92bc5c749cc56eaf498a808d51ac54d794dfed29003aeae8&a=52&b=50 http://b50.photo.store.qq.com/http_imgload.cgi?/rurl4_b=a3d0f1ad37738e911d22ede9b78091c0234be96adea1873955c272a08eed3f23d063eaeebee7081f10b8a84992766df7bdeed005322874a2eadde03c92bc5c749cc56eaf498a808d51ac54d794dfed29003aeae8&a=52&b=50 http://hi.csdn.net/attachment/201008/26/0_12827974234UXX.gif 这次应该可以看到了。 http://hi.csdn.net/attachment/201008/26/0_12827974234UXX.gif这次应该可以看到了。 <?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>没有发现边框 搞定,散分!要把滚动条的style设置一下就行了。 http://www.eoeandroid.com/thread-689-1-1.html ——请看这里。^_^ 暂时知道一种解决方法:在onCreate里给webView添加一条:webView.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY); 请问楼主,是不是WebView的loadUrl方法不能显示html中的图片?WebView有方法显示本地图文混合的html资源文件? loadUrl可以,loadData不行。本地的html文件使用file:\\\e:\test.html通过loadUrl即可显示。 android-opencv-性别识别相关问题 Android如何在视频播放过程中截图视频图片 就是运行不出来啊,log里页没有error啊。。。纠结啊 android 奇怪的问题 在电脑上编程如何获取模拟器上手机QQ的好友列表? Android测试开发工程师 VS Android开发工程师 麻烦大哥们进来看看个问题? 加一个1G的sd卡,创建了一个,但是不知道如何加到模拟器设备上去 如何用程序实现抓取android桌面 绑定ListView的时候弹出这样的错误,有时正常有时会出现这样的错误 Android 代码混淆问题 美图秀秀和魔图精灵中菜单栏的实现
<merge xmlns:android="http://schemas.android.com/apk/res/android">
<WebView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/>
</merge>
或者能传白条的图上来么?
android:id="@+id/webview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
/>
应该定义个weight
android:id="@+id/webview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
/>
这次应该可以看到了。
这次应该可以看到了。
<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>没有发现边框
要把滚动条的style设置一下就行了。
在onCreate里给webView添加一条:
webView.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);