WebView Zoom Out - more Android than B4A

canalrun

Well-Known Member
Licensed User
Longtime User
Hello,

This question is really an Android question rather than a B4A question. I have had much better results asking here vs. general Android forums -

I am using a WebView in B4A and (using the Reflection Library) Android. After loading a webpage I would like to use the on-screen Zoom out control. After one or two clicks it becomes grayed and no longer allows me to zoom out any further. When I call the zoomOut() function in code, it also does not zoom out any further.

What is limiting how much I can zoom out. I would expect to be able to zoom out much further than I am allowed - to the point of making the page too small to read. But, zoom out is disabled well before I reach this level of zoom.

Any help is greatly appreciated.

Thanks, Barry.
 

HGGER

Member
Licensed User
Longtime User
Webview.zoom

Hi Barry!

I face the same problem and I wonder if you solved the problem and if so
you may let me know how you did that?

Thanks

Heinz
 
Upvote 0

icefairy333

Active Member
Licensed User
Longtime User
B4X:
Sub Activity_Create(FirstTime As Boolean)
Dim wv As WebView
Dim wvs As WebViewSettings
wvs.setUseWideViewPort(wv,True)
setZoomRate(10)
End Sub
Sub setZoomRate(rate As Int)
   Dim r As Reflector
   r.Target=wv
   r.RunMethod2("setInitialScale",rate,"java.lang.int")
End Sub
use lib:Reflector+WebViewSettings
 
Upvote 0

HGGER

Member
Licensed User
Longtime User
Zoom Webview

Hi Barry!

Thanks for the information. The code works very well for my app.

Heinz
 
Upvote 0

ldb68

Member
Licensed User
Longtime User
B4X:
Sub Activity_Create(FirstTime As Boolean)
Dim wv As WebView
Dim wvs As WebViewSettings
wvs.setUseWideViewPort(wv,True)
setZoomRate(10)
End Sub
Sub setZoomRate(rate As Int)
   Dim r As Reflector
   r.Target=wv
   r.RunMethod2("setInitialScale",rate,"java.lang.int")
End Sub
use lib:Reflector+WebViewSettings

Thank you very much. It's works!
 
Upvote 0
Top