无法在 uiwebview 上双击缩放

发布于 2024-10-08 19:19:42 字数 427 浏览 0 评论 0原文

我需要使用手势在网络视图中启用放大和缩小。为此,我启用了scalesPageTofit 属性。但是这样做之后,我在 web 视图中显示的内容变得非常小,以至于它适合 web 视图的一个角落,而不是占据整个屏幕,我认为这是正确的,因为通过这样做,网页会缩放以适应屏幕。因此,为了解决这个问题,我在 html 文件中添加了一行,我基本上将其上传到我的 webview 中。

<meta name = "viewport" content = "width = 480, initial-scale = 1.0 user-scalable = yes">

现在网络视图适合整个屏幕,我可以通过扩展视图来放大和缩小。问题是我无法使用双击放大,但肯定可以缩小。更重要的是,我的 html 本身的大小是 320*480。 任何帮助将不胜感激。

谢谢 劳拉

I needed to enable zoom in and zoom out in webview using gestures. So for that I enabled the scalesPageTofit property. But after doing so my content that I am displaying in the webview becomes so small in size that it fits in one corner of the webview instead of taking up the entire screen and I think its right because by doing so the webpage is scaled to fit the screen. So to resolve the issue I added a line in my html file that I am basically uploading in my webview.

<meta name = "viewport" content = "width = 480, initial-scale = 1.0 user-scalable = yes">

Now the webview fits the complete screen and I can zoom in and zoom out by expanding the view. The problem is that I am unable to zoom in using double tap but can definately zoom out. One thing more the size of my html is 320*480 itself.
Any help will be appreciated.

Thanks
Laura

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

路还长,别太狂 2024-10-15 19:19:42

您是否尝试将视口内容宽度更改为 320px?
或者只是尝试双击横向方向

Did you try to change viewport content width to 320px?
Or just try double tap on landscape orientation

云归处 2024-10-15 19:19:42

我认为您在用户可扩展之前缺少一个逗号。

I think you're missing a comma before user-scalable.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文