android - Webview: How to zoom up to 100x? -
in webview have image in high resolution ( 9000x5000px ). there way zoom in in webview 100x ?
i have used code, allows me zoom 10x:
// enable zoom mywebview.getsettings().setbuiltinzoomcontrols(true); mywebview.getsettings().setsupportzoom(true);
try this, might works you.
// set activity's content view single webview test webview mwebview = new webview(this); setcontentview(mwebview); // retrieve zoommanager webview class<?> webviewclass = mwebview.getclass(); field mzoommanagerfield = webviewclass.getdeclaredfield("mzoommanager"); mzoommanagerfield.setaccessible(true); object mzoommanagerinstance = mzoommanagerfield.get(mwebview); // modify "default max zoom scale" value, controls upper limit // , set large; e.g. float.max_value class<?> zoommanagerclass = class.forname("android.webkit.zoommanager"); field mdefaultmaxzoomscalefield = zoommanagerclass.getdeclaredfield("mdefaultmaxzoomscale"); mdefaultmaxzoomscalefield.setaccessible(true); mdefaultmaxzoomscalefield.set(mzoommanagerinstance, float.max_value);
Comments
Post a Comment