1. Download our Official Android App: Forums for Android!

Apps viewport set webview zoom to fit the application ..

Discussion in 'Android Development' started by ben74, Jul 16, 2013.

  1. ben74

    ben74 Lurker
    Thread Starter
    Rank:
    None
    Points:
    25
    Posts:
    4
    Joined:
    Jul 15, 2013

    Jul 15, 2013
    4
    0
    25
    Hi, I'm developing a new webview app ( html5 canvas + javascript ) @ this location: paint test

    I'm trying to fit & fix the webview zoom in order to fit it on every possible device ..

    #here is for viewport that only fits with chrome on galaxy note

    <meta name="viewport" content="width=1207,height=631,initial-scale=0.5,minimum-scale=0.5,maximum-scale=1,user-scalable=no">

    ( note : with webview or base android navigator I have to double tap on time to get the zoom at it's correct level ... and have not found this far how to emulate this double tap outside zoom effect .. )

    Java :
    WebView b=(WebView)findViewById(R.id.webview);WebSettings s=b.getSettings();
    s.setJavaScriptEnabled(true);s.setLoadWithOverviewMode(true);s.setUseWideViewPort(true);
    s.setDefaultZoom(ZoomDensity.FAR);b.setInitialScale(0);b.setVisibility(View.GONE);
    b.loadUrl('http://prechoix.fr/z/paint/1.html');b.reload();b.setVisibility(View.VISIBLE);

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

    & manifest in landscape mode

    As I'm having a wild time trying to fix this, more than 20 hours currently, and having no correct answers at all from stackoverflow I'm asking for help, here currently

    Any advice would be greatly appreciated
    Thanks in advance :) :smokingsomb:
     

    Advertisement

Share This Page

Loading...