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 方向在浏览器中更改?


- 在测试浓缩咖啡时,Android设备不会在屏幕上启动活动 2022-01-01
- Android viewpager检测滑动超出范围 2022-01-01
- 使用自定义动画时在 iOS9 上忽略 edgesForExtendedLayout 2022-01-01
- 想使用ViewPager,无法识别android.support.*? 2022-01-01
- MalformedJsonException:在第1行第1列路径中使用JsonReader.setLenient(True)接受格式错误的JSON 2022-01-01
- android 4中的android RadioButton问题 2022-01-01
- 如何检查发送到 Android 应用程序的 Firebase 消息的传递状态? 2022-01-01
- 用 Swift 实现 UITextFieldDelegate 2022-01-01
- Android - 拆分 Drawable 2022-01-01
- Android - 我如何找出用户有多少未读电子邮件? 2022-01-01