Skip to content Skip to sidebar Skip to footer

Loading Webview Is Not Filled With Device Screen?

I have a problem with webview. It is not loaded with full screen. I have tried all post answer from stackoverflow but couldn't solve my problem (webview width and height are match

Solution 1:

Add this command in your webview settings

webview.getSettings().setLayoutAlgorithm(LayoutAlgorithm.NORMAL);
webview.getSettings().setLoadWithOverviewMode(true);
webview.getSettings().setUseWideViewPort(true);
webview.getSettings().setJavaScriptEnabled(true);

Solution 2:

Do you support all screen sizes?

Add following to the manifest:

<supports-screensandroid:smallScreens="true"android:normalScreens="true"android:largeScreens="true"android:xlargeScreens="true"android:anyDensity="true"/>

Solution 3:

What does your layout look like? Make sure your layout_width and layout_height are set to "fill_parent". I think it's set to wrap_content by default.

    <WebView
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:id="@+id/webView"
    android:layout_gravity="center"/>

Post a Comment for "Loading Webview Is Not Filled With Device Screen?"