是否可以防止 iPhone/iPad 方向在浏览器中更改? [英] Is it possible to prevent iPhone/iPad orientation changing in the browser?

查看:19
本文介绍了是否可以防止 iPhone/iPad 方向在浏览器中更改?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在这个问题上看到过类似的问题,但它们与本机应用程序有关.我为 iPhone/iPad 构建在浏览器 (Safari) 中运行的网络应用程序.

I've seen similar questions on this issue, but they are related to native apps. I build web apps for the iPhone/iPad that run in the browser (Safari).

我想知道是否有办法防止浏览器中的方向改变,也许是通过一些元标记.我知道允许您指定缩放和缩放功能的视口元标记,因此认为方向可能有类似的东西.

I was wondering if there is a way to prevent orientation change in the browser, perhaps via some meta tag. I know of the viewport meta tag which allows you to specify scale and zooming capabilities, so figured maybe there is something similar for orientation.

我怀疑这是可能的,但我想我只是在这里提出一个问题来看看.

I doubt it is possible, but I thought I'd just pop a question on here to see.

推荐答案

似乎无法阻止方向改变,但您可以使用上面提到的代码进行检测.

It does not appear to be possible to prevent orientation change, but you can detect it with the code mentioned above.

如果您想阻止方向更改,您似乎需要使用 WebKit 构建一个本机应用程序来取消该事件.

If you want to prevent orientation change it appears as though you'll need to build a native app using WebKit which quashes the event.

这篇关于是否可以防止 iPhone/iPad 方向在浏览器中更改?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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