windows phone 8.1应用程序的XAML中不提供SupportedOrientations?

windows phone 8.1应用程序的XAML中不提供SupportedOrientations?,xaml,windows-phone-8,windows-phone-8.1,Xaml,Windows Phone 8,Windows Phone 8.1,在Windows Phone 8.1应用程序中,与此等效的是什么。当我创建一个新的应用程序时,不再有phone:ApplicationPage <phone:PhoneApplicationPage ... ... SupportedOrientations="Landscape" Orientation="LandscapeLeft" shell:SystemTray.IsVisible="False"> 是的,在windows phone 8.1中,我们无法在页面的XAML中

在Windows Phone 8.1应用程序中,与此等效的是什么。当我创建一个新的应用程序时,不再有phone:ApplicationPage

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


是的,在windows phone 8.1中,我们无法在页面的XAML中设置supportedOrientations。我们只能在Package.appxmanifest中设置应用程序的supportedOrientations。

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


微软在将WindowsPhoneSilverlight移植到WindowsPhone8.1WinRT时又忘记了这一点。我们只能锁定整个应用程序,而不是单个页面。很好。这是一种方法,但它会锁定整个应用程序的旋转。如果只锁定一个页面,则必须在OnNavigatedFrom中重置AutoRotationPreferences。@JürgenBayer它对我不起作用。方向未锁定:(
DisplayInformation.AutoRotationPreferences = DisplayOrientations.Landscape;
DisplayInformation.AutoRotationPreferences = DisplayOrientations.LandscapeFlipped;
DisplayInformation.AutoRotationPreferences = DisplayOrientations.Portrait;