Android Question Hide Magnifying Glass on Webview

DawningTruth

Active Member
Licensed User
I have looked at the various options and I can't get rid of the webview magnifying glass:


I am using the following code:

B4X:
Dim MyWebSettings As WebSettings = MyWebViewExtras.GetSettings

MyWebSettings.SetSupportZoom(True)
MyWebSettings.SetBuiltInZoomControls(True)
MyWebSettings.SetDisplayZoomControls(False)

My Manifest:

<uses-sdk android:minSdkVersion="16" android:targetSdkVersion="26"/>

Any suggestions?
 

JohnC

Expert
Licensed User
Longtime User
Remove the above code and install the "WebView Settings" library, then add this:

B4X:
Dim wv as WebView '(your webview control)
Dim wvs As WebViewSettings

wvs.setDisplayZoomControls(wv,False)
 
Upvote 0

DawningTruth

Active Member
Licensed User
Thx for all the replies. Based on the above advice I am using the following code:

B4X:
Dim r As Reflector
   r.Target = thisWebview
   r.Target = r.RunMethod("getSettings")
   r.RunMethod2("setSupportZoom", True, "java.lang.boolean")
   r.RunMethod2("setBuiltInZoomControls", True, "java.lang.boolean")
   r.RunMethod2("setDisplayZoomControls", False, "java.lang.boolean")
   r.RunMethod2("setUseWideViewPort", True, "java.lang.boolean")
   r.RunMethod2("setLoadWithOverviewMode", True, "java.lang.boolean")

I would think this would be the most direct way of interacting with the webview. I have also tried on two different phones. Still not working.

Any other suggestions?
 
Upvote 0

DawningTruth

Active Member
Licensed User
Solved it. First tested the above code on a very basic webview only app. It worked perfectly. But still did not work in my app.

Then made a change in the Designer, and now it works on my app.

Here is the change I made:


I unchecked the ZoomEnabled box. I think the setting was interfering with the code.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…