首页 > 解决方案 > 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. or the application delegate's supportedInterfaceOrientations. However, this doesn't seem to work in that way with Uno. How should this be done instead?

标签: c#uno-platform

解决方案


Since the implementation of the DisplayInformation class in Uno, the application references its AutoRotationPreferences property by default, instead of referencing the Info.plist configuration.

To exclude or include a orientation from the AutoRotation behaviour you can set this in code:

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

推荐阅读