Windows Phone 8.1 应用程序的 XAML 中 SupportedOrientations 不可用?

2024-03-12

Windows Phone 8.1 App 中与此等效的是什么?当我创建新应用程序时,不再有电话:ApplicationPage

<phone:PhoneApplicationPage
...
...
SupportedOrientations="Landscape" Orientation="LandscapeLeft"
shell:SystemTray.IsVisible="False">

您可以通过代码强制任何页面的方向,在 this.InitializeComponent() 之后编写:

DisplayInformation.AutoRotationPreferences = DisplayOrientations.Landscape;

or

DisplayInformation.AutoRotationPreferences = DisplayOrientations.LandscapeFlipped;

or

DisplayInformation.AutoRotationPreferences = DisplayOrientations.Portrait;
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Windows Phone 8.1 应用程序的 XAML 中 SupportedOrientations 不可用? 的相关文章

随机推荐