Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SupportedOrientations unavailable in XAML of windows phone 8.1 app?

What is the equivalent of this in Windows Phone 8.1 App. When I create a new app, there is no more phone:ApplicationPage

<phone:PhoneApplicationPage
...
...
SupportedOrientations="Landscape" Orientation="LandscapeLeft"
shell:SystemTray.IsVisible="False">
like image 456
erotavlas Avatar asked May 07 '14 02:05

erotavlas


2 Answers

You can force the orientation of any page via code, writing just after the this.InitializeComponent():

DisplayInformation.AutoRotationPreferences = DisplayOrientations.Landscape;

or

DisplayInformation.AutoRotationPreferences = DisplayOrientations.LandscapeFlipped;

or

DisplayInformation.AutoRotationPreferences = DisplayOrientations.Portrait;
like image 133
the_nuts Avatar answered Nov 16 '22 10:11

the_nuts


Yes, In windows phone 8.1, We can't set supportedOrientations in page's XAML. We can set supportedOrientations of App in Package.appxmanifest only.

like image 29
Chris Shao Avatar answered Nov 16 '22 10:11

Chris Shao