Web View with zoom

0

I have a web view being loaded on screen (mounted by an internal HTML) that sometimes opens with zoom and others without the zoom . I do not want it to open with zoom , I need it to open in full screen!

Here the layout snippet

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

    <WebView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/webViewReport"
        android:layout_below="@+id/button_report"
        android:layout_alignParentBottom="true"
        android:layout_alignParentEnd="true"
        android:layout_alignParentStart="true" />

</LinearLayout>

Here I load the HTML and play pro WV

montaHTML();

wv = (WebView) findViewById(R.id.webViewReport);
ws = wv.getSettings();
ws.setJavaScriptEnabled(true);
ws.setSupportZoom(true);
ws.setDefaultTextEncodingName("utf-8");
wv.loadData(html, "text/html; charset=utf-8", "UTF-8");
    
asked by anonymous 27.04.2017 / 01:41

1 answer

0

Try adding this method: ws.setLoadWithOverviewMode(true); . It defines whether the WebView page load will be in overview mode, moving content away to fit the screen across the width.

Reference:

link

    
27.04.2017 / 03:42