一个web视图中的表单字段时,点击禁用变焦? [英] Disable zoom when clicking on form fields within a WebView?

查看:109
本文介绍了一个web视图中的表单字段时,点击禁用变焦?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经经历了几十页看,如果类似的问题,他们都没有任何答案,所以希望这一次会有所不同。

I've looked through dozens of pages if similar questions, none of them have any answers, so hopefully this one will be different.

我有一个web视图,而我不希望视图的缩放,从最初的缩放级别我有它设置改变。 这会改变缩放级别目前的唯一的事情是,当一个文本框的重点是

I have a webview, and I do not want the zoom of the view to change from the initial zoom level I have it set to. The only thing which changes the zoom level currently is when a text box is focused.

我需要能够通过Java code要做到这一点,不使用视meta标签。

I need to be able to do this through Java code, not using the viewport meta tag.

只是让我没有共同的反应,我有以下我的code禁用缩放和缩放控件:

Just so I don't have the common responses, I have the following in my code to disable zooming, and the zoom controls:

mWebView.getSettings().setBuiltInZoomControls(false);
mWebView.getSettings().setSupportZoom(false);

我在想,一个可能的解决方案是检查的时候看到的聚焦状态,甚至onClick事件发生的WebView内,然后zoomOut,但我也不知道这是可能的吗?

I'm thinking that a possible solution is to check to see when an onFocus or even an onClick event occurs within the WebView and then zoomOut, but I'm not even sure if that is possible?

任何建议将是AP preciated。

Any suggestions would be appreciated.

推荐答案

此问题已得到修复在HTC设备的固件更新,这是(显然)被引起的Sense UI覆盖默认的Andr​​oid功能不正常。

This issue has been fixed by a firmware update on HTC devices, it was (apparently) being caused by the Sense UI overriding default Android functionality incorrectly.

这是很难提供确切地当这已得到纠正的信息,但是我的web应用程序不再放大时,文本框被点击了最新的固件上的HTC设备。

It is very difficult to provide information on exactly when this was corrected, however my web application no longer zooms when a text box is clicked on any HTC device with the latest firmware.

下面两行code将禁用一个机器人的WebView的放大方面的内容:

The following two lines of code will disable the "zoom" aspects of an android webview:

// disables the actual onscreen controls from showing up
mWebView.getSettings().setBuiltInZoomControls(false);
// disables the ability to zoom
mWebView.getSettings().setSupportZoom(false);

这篇关于一个web视图中的表单字段时,点击禁用变焦?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆