Is it possible to pinch to zoom in cordova

前端 未结 1 1929
無奈伤痛
無奈伤痛 2021-01-07 15:16

There is not a lot of information on this, and the little that I have been able to find is very vague and unhelpful. I imply want a page in my cordova/phonegap app to have

1条回答
  •  终归单人心
    2021-01-07 16:13

    In the native code just after this line

    super.loadUrl(Config.getStartUrl());
    

    Add this

    WebSettings settings = super.appView.getSettings();
    settings.setBuiltInZoomControls(true);
    settings.setDisplayZoomControls(true);
    settings.setSupportZoom(true);
    

    You'll need this in native part

    import android.webkit.WebSettings;
    

    And in the page you want to zoom, add this

    
                                                            
0 讨论(0)
提交回复
热议问题