【问题标题】:How to set the orientation for required pages to landscape and other pages in portrait mode in phonegap application for both android and iOS如何在 Android 和 iOS 的 phonegap 应用程序中将所需页面的方向设置为横向和纵向模式的其他页面
【发布时间】:2016-02-23 09:49:27
【问题描述】:

我正在开发企业应用程序,它是 phonegap 中适用于 android 和 iOS 的仪表板应用程序。在我的应用程序中,需要在纵向模式下开发 4 个屏幕,而其他屏幕应该在横向模式下。在这里,我需要将屏幕方向纵向设置为纵向,将横向设置为横向,而与传感器无关(无需旋转手机)。我进行了 3 多天的研究,但无法找到正确的插件或正确的代码。已经尝试使用-webkit-transform:rotate(-90deg),但是屏幕被横向的纵向尺寸占据,因此屏幕在4个方向上占据了额外的空间。请向我推荐任何绝对有效的解决方案。

【问题讨论】:

标签: jquery css cordova mobile cordova-plugins


【解决方案1】:

使用@media 标签(我不太熟悉,几周前才开始使用)。关于如何做到这一点的两篇好文章(完全阅读,因为两者都有很好的答案)

forcing web-site to show in landscape mode only

Force “Landscape” orientation mode

【讨论】:

    猜你喜欢
    • 2020-12-26
    • 2019-07-23
    • 1970-01-01
    • 1970-01-01
    • 2012-01-04
    • 2020-03-07
    • 1970-01-01
    • 2018-01-11
    • 1970-01-01
    相关资源
    最近更新 更多