lacas
lacas

Reputation: 14066

Android webview only zoom in

i have a html output, wich is full screen at the start. With the zoom control i can zoom in/out.

I want only zoom in, and not out. So: the minimal zoom out i want is 100% of the full screen. And the maximal zoom in i want to 400%.

Is there a way to do it?

Thanks

Upvotes: 2

Views: 1659

Answers (2)

alaeri
alaeri

Reputation: 344

If you can modify the html you display, I would suggest doing it the easy way. insert this meta tag in the head element in HTML

    <meta name='viewport' content='target-densitydpi=device-dpi,initial-scale=1,minimum-scale=1,user-scalable=yes'/>

you can modify the value of minimum-scale to suit your needs.

Upvotes: 3

Jan
Jan

Reputation: 633

Doing it the hard way, I would suggest to

  • disable the built-in zoom controls via WebSettings.setBuiltInZoomControls(false)
  • add your own zoom control buttons on top of the WebView using FrameLayout

Upvotes: 1

Related Questions