如何在 Windows Universal Apps 中让页面保持纵向模式?

How to keep the page in Portrait mode in Windows Universal Apps?

我正在将我的 Windows Phone 应用程序迁移到 Windows 通用应用程序。在我的 phone 应用程序中,有一个属性 Support Orientation,我们可以为其设置值 Portrait,Landscape.I 希望在 Windows 8.1 中实现相同的值通用应用程序的应用程序。即使此人在横向模式下旋转 his/her 平板电脑,我的应用程序也不应旋转。

请帮助我如何实现这一目标?

谢谢

您可以在 DisplayInformation class 中设置 AutoRotationPreferences 属性。

DisplayInformation.AutoRotationPreferences = DisplayOrientations.Portrait;

您应该只需要在您的应用程序中设置此 属性 一次。