Android底部白色条纹填充Webview内容时 [英] Android Bottom White Stripe When Filling Webview Content
问题描述
setScrollBarStyle(WebView.SCROLLBARS_INSIDE_OVERLAY);
但是,我尝试了许多选项来删除底部没有成功的选项。即使我读完所有相关的帖子。如果需要更多的代码,请让我知道。
xml
< LinearLayout xmlns:android =http://schemas.android.com/apk/res/android
android:layout_width =fill_parent
android:layout_height = fill_parent
>
< WebView android:autoLink =web
android:layout_width =fill_parent
android:layout_height =fill_parent
android:id =@ + id / webview1
android:textColor =@ android:color / black
>< / WebView>
< / LinearLayout>
活动
browse =(WebView)findViewById(R.id.webview1);
browse.getSettings()。setJavaScriptEnabled(true);
browse.getSettings()。setUseWideViewPort(true);
browse.getSettings()。setLoadWithOverviewMode(true);
browse.setScrollBarStyle(WebView.SCROLLBARS_INSIDE_OVERLAY);
browse.setScrollbarFadingEnabled(false);
在您的WebView xml中,添加android:scrollbars =无
< WebView android:autoLink =web
android:layout_width =fill_parent
android:layout_height =fill_parent
android:id =@ + id / webview1
android:textColor =@ android:color / black
android:scrollbars =none
>< / WebView>
并删除 setScrollBarStyle(WebView.SCROLLBARS_INSIDE_OVERLAY);
Once an HTML is loaded in to a webview, I get a white stripe on the right and bottom of the layout. For the right one I solved it using:
setScrollBarStyle(WebView.SCROLLBARS_INSIDE_OVERLAY);
However, I have tried many options to remove the bottom one with no success. Even after I read all the related posts. If more code is required please let me know.
xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<WebView android:autoLink="web"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/webview1"
android:textColor="@android:color/black"
></WebView>
</LinearLayout>
activity
browse = (WebView) findViewById(R.id.webview1);
browse.getSettings().setJavaScriptEnabled(true);
browse.getSettings().setUseWideViewPort(true);
browse.getSettings().setLoadWithOverviewMode(true);
browse.setScrollBarStyle(WebView.SCROLLBARS_INSIDE_OVERLAY);
browse.setScrollbarFadingEnabled(false);
In your WebView xml, add android:scrollbars="none"
<WebView android:autoLink="web"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/webview1"
android:textColor="@android:color/black"
android:scrollbars="none"
></WebView>
And remove the setScrollBarStyle(WebView.SCROLLBARS_INSIDE_OVERLAY);
这篇关于Android底部白色条纹填充Webview内容时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!