开发者

disabled built in zoom controls disable pinch zoom, too

开发者 https://www.devze.com 2023-03-22 19:29 出处:网络
I have a WebView which should support zoom. The UI design requires custom zoom controls and therefore I disabled the built in zoom controls. The problem now, the pinch zoom is disabled, too. Setting t

I have a WebView which should support zoom. The UI design requires custom zoom controls and therefore I disabled the built in zoom controls. The problem now, the pinch zoom is disabled, too. Setting the built in controls enables the pinch zoom.

final WebSettings settings = mWebVi开发者_StackOverflow中文版ew.getSettings();
settings.setBuiltInZoomControls(false); // disables the pinch zoom, too
settings.setSupportZoom(true);

Does someone know a solution to disable/hide the built in controls and keep the pinch zoom?


Yes there is a function setDisplayZoomControls,
Sets whether the on screen zoom buttons are used. A combination of built in zoom controls enabled and on screen zoom controls disabled allows for pinch to zoom to work without the on screen controls

NOTE: Since API Level 11 only:(

0

精彩评论

暂无评论...
验证码 换一张
取 消