【问题标题】:Qt set iOS screen orientationQt设置iOS屏幕方向
【发布时间】:2017-09-13 08:35:16
【问题描述】:

在 Qt 中开发跨平台应用程序。我需要能够强制几页的屏幕方向。我找到了一种适用于 Android 的方法,但我找不到适用于 iOS 的任何东西。

有没有办法在 iOS 中强制设置屏幕方向?

更好的是,是否有一个调用可以为任何给定的移动平台设置屏幕方向?

谢谢!

【问题讨论】:

    标签: c++ ios qt qml


    【解决方案1】:

    看看这里:

    https://doc.qt.io/qt-5/qml-qtquick-window-screen.html#orientation-attached-prop

    您可以将 Screen.orientation(或 Screen.primaryOrientation)属性写入您自己的属性中,并使用 onChanged 事件处理程序来获取 Signal,例如:

    readonly property var screenOrientation: Screen.orientation
    
    onScreenOrientationChanged: {
    console.log("Orientation Changed!")
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-11-13
      • 2013-06-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多