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

查看:129
本文介绍了是否可以防止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).

我想知道是否有办法防止方向改变浏览器,也许是通过一些元标记。
我知道viewport元标记允许你指定缩放和缩放功能,因此可能会有类似的方向。

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天全站免登陆