简体   繁体   English

如何管理 Uno App 至少支持 iOS 的方向?

[英]How to manage the orientations a Uno App supports on at least iOS?

Normally, the orientations that an iOS supports are either defined by the app's Info.plist file.通常,iOS 支持的方向由应用程序的 Info.plist 文件定义。 or the application delegate's supportedInterfaceOrientations .或应用程序委托的supportedInterfaceOrientations However, this doesn't seem to work in that way with Uno.但是,这似乎不适用于 Uno。 How should this be done instead?应该怎么做呢?

Since the implementation of the DisplayInformation class in Uno, the application references its AutoRotationPreferences property by default, instead of referencing the Info.plist configuration.由于在Uno中实现了DisplayInformation class,应用程序默认引用其AutoRotationPreferences属性,而不是引用Info.plist配置。

To exclude or include a orientation from the AutoRotation behaviour you can set this in code:要从 AutoRotation 行为中排除或包含方向,您可以在代码中进行设置:

using Windows.Graphics.Display;
...
DisplayInformation.AutoRotationPreferences = DisplayOrientations.Portrait;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM