Android Question Hide Webview Zoom Controls but still have zoom

tsteward

Well-Known Member
Licensed User
Is it possible to turn off the + & - zoom buttons on a webview but still have pinch zoom.

If I turn off zoom in the designer the buttons are gone but can no longer pinch zoom.
If I leave it on in designer and use the webviewsettings library I have tried
setDisplayZoomControls does not have any effect.
setSupportZoom will turn zoom control off completely.

Again I want zoomability just not the buttons displayed.

Thanks
Tony
 

tsteward

Well-Known Member
Licensed User
Thank you Erel,
After adding your code above I get the following error
java.lang.RuntimeException: Method: setBuiltInZoomControls not found in: android.webkit.WebView
 

kisoft

Well-Known Member
Licensed User
HI
I added this code to my project and I get this error.
B4X:
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
Cannot get methods of class: com.android.webview.chromium.ContentSettingsAdapter, disabling cache.
Error occurred on line: 36 (Main)
java.lang.ClassNotFoundException: com.android.webview.chromium.ContentSettingsAdapter
    at java.lang.Class.classForName(Native Method)
    at java.lang.Class.forName(Class.java:453)
    at java.lang.Class.forName(Class.java:378)
    at anywheresoftware.b4j.object.JavaObject$MethodCache.getMethod(JavaObject.java:342)
    at anywheresoftware.b4j.object.JavaObject.RunMethod(JavaObject.java:119)
    at kamil.sc.main._activity_create(main.java:403)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:738)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:360)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:260)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
    at kamil.sc.main.afterFirstLayout(main.java:104)
    at kamil.sc.main.access$000(main.java:17)
    at kamil.sc.main$WaitForLayout.run(main.java:82)
    at android.os.Handler.handleCallback(Handler.java:789)
    at android.os.Handler.dispatchMessage(Handler.java:98)
    at android.os.Looper.loop(Looper.java:164)
    at android.app.ActivityThread.main(ActivityThread.java:6710)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
 
Top