Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/84.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
webview中的Android 4长html_Android_Html_Android Webview - Fatal编程技术网

webview中的Android 4长html

webview中的Android 4长html,android,html,android-webview,Android,Html,Android Webview,我有一个web视图,其中显示从硬编码字符串(大约1500个字符)加载的HTML。 HTML验证程序中测试的HTML。 html很简单,它包含div和p标记,而不是javascript。 只有在Android版本4上,我才有一个带有滚动条的空白页面,在低于4的Android版本上,效果很好。 不幸的是,我无法公开孔代码 Android 4 WebView有什么不同吗 我的代码: mWebView.setWebChromeClient(mWebChromeClient); mWebView.setW

我有一个web视图,其中显示从硬编码字符串(大约1500个字符)加载的HTML。 HTML验证程序中测试的HTML。 html很简单,它包含div和p标记,而不是javascript。 只有在Android版本4上,我才有一个带有滚动条的空白页面,在低于4的Android版本上,效果很好。 不幸的是,我无法公开孔代码

Android 4 WebView有什么不同吗

我的代码:

mWebView.setWebChromeClient(mWebChromeClient);
mWebView.setWebViewClient(mWebViewClient);
mWebView.addJavascriptInterface(new JavaScriptInterface(getActivity()),JavaScriptInterface.NAME);

if (CLEAR_CACHE_ON_LOAD) {
    mWebView.clearCache(true);
}

mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.getSettings().setJavaScriptCanOpenWindowsAutomatically(false);

mWebView.loadDataWithBaseURL("fake://", htmlString, "text/html", "UTF-8", "fake://");
//OR -
mWebView.loadData(htmlBase64String, "text/html", "base64");
XML:

<ScrollView
    android:id="@+id/scrollView"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_below="@+id/expandingView" >

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical" >
        <FrameLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content" >
            <WebView
                android:id="@+id/webview"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:fadingEdge="vertical"
                android:layerType="software"
                android:scrollbars="none" />

            <View
                android:id="@+id/webViewClickOverlay"
                android:layout_width="match_parent"
                android:layout_height="match_parent" />
        </FrameLayout>

        <LinearLayout
            android:id="@+id/more_about_container"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="@drawable/color_white_grey_selector"
            android:gravity="center_vertical"
            android:padding="@dimen/padding_medium"
            android:visibility="gone" >
            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginRight="@dimen/padding_medium"
                android:text="@string/more_about"
                android:textColor="@color/vocativ_purple"
                android:textSize="@dimen/text_size_medium"
                android:textStyle="bold" />
            <TextView
                android:id="@+id/label_more_about"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:ellipsize="end"
                android:lines="1"
                android:text="SECOND NIGHT OF BLA"
                android:textColor="@color/vocativ_pink"
                android:textSize="@dimen/text_size_medium"
                android:textStyle="bold" />
            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:drawableRight="@drawable/ic_arrow_pink" />
        </LinearLayout>

        <include
            android:id="@+id/related_content_container"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            layout="@layout/widget_story_container" />
    </LinearLayout>

</ScrollView>

需要设置 android:layerType=“软件”至android:layerType=“无”


查看下一个

是的,它是web视图上的一个层