无法在 uiwebview 上双击缩放
我需要使用手势在网络视图中启用放大和缩小。为此,我启用了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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您是否尝试将视口内容宽度更改为 320px?
或者只是尝试双击横向方向
Did you try to change viewport content width to 320px?
Or just try double tap on landscape orientation
我认为您在
用户可扩展
之前缺少一个逗号。I think you're missing a comma before
user-scalable
.