java - 填充Webview内容时的Android底部白色条纹

标签 java android eclipse html jquery-mobile

将 HTML 加载到 Web View 后,我会在布局的右侧和底部看到一条白色条纹。对于正确的一个,我使用以下方法解决了它:

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>

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

最佳答案

在您的 WebView xml 中,添加 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>

并移除 setScrollBarStyle(WebView.SCROLLBARS_INSIDE_OVERLAY);

关于java - 填充Webview内容时的Android底部白色条纹,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9708220/

相关文章:

java - 将现有的 Eclipse 项目转换为 Maven 项目

java - 我从互联网复制的代码中收到错误

android - 在一个框架中创建多个部分并使每个部分单独工作

android - 从 Android 应用程序在 youtube 上上传视频

android - 如何将 Android 调试 keystore 放入颠覆存储库,然后让 Eclipse 使用它?

c - 如何使用Arduino的串口打印

java - 带有 SWT 的 jBPM 独立应用程序

java - JAXB - 生成示例 xml?

java - 获取有关包含对象的数组的信息 - Java

java - 使用 JCufft 进行实数到复数 FFT