Android - WebView inside ScrollView leaves blank space at bottom

I want to add multiple WebViews to the scroll container. To do this, I add them programmatically inside LinearLayout.

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
 android:id="@+id/scrollView"
 android:layout_width="fill_parent"
 android:layout_height="fill_parent">

 <LinearLayout
        android:id="@+id/webViewContainer"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:orientation="vertical"
        />

 </ScrollView>

Now the problem is loading the data into the WebView using the loadDataWithBaseURL () method, WebViews leave some extra space at the bottom. Could not find the correct solution to this problem. Can someone please tell me why this is happening?

+5
source share
1 answer
WebView webView = new WebView(this);
        webView.loadDataWithBaseURL("about:blank",
                Utils.getHtmlData(article.getContent()), "text/html",
                "utf-8", null);
        rl_wrapper.removeAllViews();
        rl_wrapper.addView(webView);

I use a shell, replace webview, English is not my native language, but also hope this can help you.

0
source

All Articles