Is there a way to disable the zoom feature on input fields in webview?

后端 未结 10 1409
南笙
南笙 2021-02-05 21:18

When a user clicks in an input field or textarea, the application zooms in. Is there a simple way to disable it?

Currently have the meta tag:

meta name=\         


        
10条回答
  •  日久生厌
    2021-02-05 21:30

    I know this thread is ancient history but I had the scaling issue with the virtual keyboard and eventually found the solution at this link:

    http://rickluna.com/wp/2012/02/set-app-scaling-in-phonegap-android/

    Add these lines to the app's java source

    appView.getSettings().setSupportZoom(false);
    appView.getSettings().setUseWideViewPort(false);
    WebSettings ws = appView.getSettings();
    ws.setDefaultZoom(WebSettings.ZoomDensity.MEDIUM);
    appView.getSettings().setDefaultZoom(WebSettings.ZoomDensity.MEDIUM);
    appView.setInitialScale(0);
    ws.setSupportZoom(false);
    ws.setBuiltInZoomControls(false);
    ws.setUseWideViewPort(false);
    

    I changed MEDIUM to FAR which keeps the screen at the original 1.0 magnification.

    Hopefully that saves other people some searching

提交回复
热议问题