当视口设置为user-scalable = no时,iOS /移动safari仍会缩放?检查辅助功能设置! [英] iOS / mobile safari still zooms while viewport is set to user-scalable=no ? Check Accessibility settings!

查看:112
本文介绍了当视口设置为user-scalable = no时,iOS /移动safari仍会缩放?检查辅助功能设置!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这个特定的移动Safari(看似不可能但未记录)的问题让我今天长时间停留,当我想出来的时候,我正准备在这里发布一个关于它的问题。

问题:我设置< meta name =viewportcontent =width = device-width; initial-scale = 1.0 ; maximum-scale = 1.0; minimum-scale = 1.0; user-scalable = no;/> 我的iPad web-app仍允许手动缩放(在浏览器中捏合)。 - 但只能在我的iPad上,而不能在我的iPhone上。

The problem: While I had set <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; minimum-scale=1.0; user-scalable=no;"/> my iPad web-app still allowed manual zooming (pinching in the browser). -- But only on my iPad, not on my iPhone.

此外,我还会在纵向模式之间旋转设备以检查特定的方向模式CSS代码,这给了奇怪的结果:

Also I would rotate the device between portrait to landscape modes to check the the specific orientation-mode CSS codes, which gave strange results:


  • 从横向旋转到肖像没有问题,所有的尺寸和位置都有意义。

  • 之后,从纵向旋转回到横向和..视口保持与纵向模式一样宽,即。它被缩放(缩放)。我不得不手动缩小以返回完整的图片/视口。这应该是不可能的。

推荐答案

然后我找到了伟大的带有横向/纵向模式的iPad CSS布局演示。它看起来很有希望,但给了我同样的问题。然而,当在第二台iPad上进行测试时,它的工作非常完美:没有任何缩放问题。因此,我们认为它与我的特定iPad有关。

I then found the great iPad CSS Layout with Landscape/Portrait Modes demo. It looked promising, but gave me the identical problem. Yet while testing this on a second iPad it worked perfect: no zooming problem whatsoever. So, we figured it had to do with my specific iPad.

然后它让我感到震惊:几周前我摆弄了辅助功能设置。像在OSX中那样放大整个界面(ctrl + scroll)等。也许这在某种程度上与Mobile Safari相关联?事实证明它是。

Then it struck me: Weeks ago I fiddled around with the accessibility settings. Zooming in on the entire interface like you can do in OSX (ctrl+scroll) etc. Maybe this was linked to Mobile Safari in some way? Well, it turns out it is.

今天我了解到:当启用辅助功能>缩放时,这会取代元视口设置。

亲自尝试一下吗?你会在这里找到它:设置>一般>可访问性>缩放

Try this out yourself? You'll find it here: Settings > General > Accessibility > Zoom

这篇关于当视口设置为user-scalable = no时,iOS /移动safari仍会缩放?检查辅助功能设置!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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