N
N
newdancer2016-03-18 20:45:56
Java
newdancer, 2016-03-18 20:45:56

How to expand webview to full screen?

How to expand webview to full screen?
There are activities:

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">

<WebView
    android:id="@+id/webview"
    android:layout_width="match_parent"
    android:layout_height="match_parent"/>

<FrameLayout
    android:id="@+id/fullscreen_container"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:visibility="gone"/>

</FrameLayout>

Passing iframe to webview
String strframe = "<iframe src=\""+iframe_url+"\" width=\""+"100%"+"\" height=\""+"100%"+"\" frameborder=\"0\" allowfullscreen></iframe>";
        webView = (WebView) findViewById(R.id.webview);
        webView.getSettings().setJavaScriptEnabled(true);
        webView.loadData(strframe, "text/html", "utf-8");

The content is displayed with padding around the edges. how to display it in full screen at once?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question