Qt设置iOS屏幕方向

时间:2017-04-17 17:29:25

标签: c++ ios qt qml

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

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

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

谢谢!

1 个答案:

答案 0 :(得分:0)

在这里看看:

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

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

readonly property var screenOrientation: Screen.orientation

onScreenOrientationChanged: {
console.log("Orientation Changed!")
}
相关问题