In Webview as it is centered on the width of the screen

1

I'm adjusting a local web page, the width of the screen.

I am using this code to adjust it to the width of the screen

    mWebView.getSettings().setBuiltInZoomControls( true );
    mWebView.getSettings().setDisplayZoomControls( false );
    mWebView.getSettings().setSupportZoom( true );
    mWebView.getSettings().setDefaultZoom( WebSettings.ZoomDensity.FAR );
    mWebView.getSettings().setLoadWithOverviewMode( true );
    mWebView.getSettings().setUseWideViewPort( true );
    mWebView.setInitialScale(1);

mWebView.loadUrl( "file:///android_asset/pagina.htm" );

As you can see in the following image, it is not centered, the line of numbers that had to be stuck, or with the same separation on both sides, is stuck to the right side.

Instead, the text above is shown closer to the left side, and the web page I have since it is shown centered <center>

menu_2.xml

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.SoCu.CirDocu.Menu_2">

<!-- TODO: Update blank fragment layout -->
<WebView
    android:id="@+id/webView1"
    android:layout_width="match_parent"
    android:layout_height="match_parent" />

</FrameLayout>

Is there any way to correct it?

Edited As the problem has been blocked and it seems that without solution, I delete the code that nobody has problems with, since it does not work as it should be.

Thank you.

    
asked by SoCu 06.03.2018 в 21:22
source

0 answers