Is it possible to prevent iPhone/iPad orientation changing in the browser?(是否可以防止 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 方向在浏览器中更改?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:是否可以防止 iPhone/iPad 方向在浏览器中更改?


基础教程推荐
- navigator.geolocation.getCurrentPosition 在 Android 浏览器上 2022-01-01
- Cocos2d iPhone 非矩形精灵触摸检测 2022-01-01
- NSString intValue 不能用于检索电话号码 2022-01-01
- 通过重定向链接在 Google Play 中打开应用 2022-01-01
- 如何从 logcat 中删除旧数据? 2022-01-01
- libGDX 从精灵或纹理中获取像素颜色 2022-01-01
- AdMob 广告未在模拟器中显示 2022-01-01
- iPhone - 获取给定地点/时区的当前日期和时间并将其与同一地点的另一个日期/时间进行比较的正确方法 2022-01-01
- Android:getLastKnownLocation(LocationManager.NETWORK_PROVIDER 2022-01-01
- iOS4 创建后台定时器 2022-01-01