Windows Phone 8.1 and Windows Runtime Apps How to #9 – Set Supported Orientations in WP 8.1

In Windows Phone 8.1 App , if you want to set the supported orientations , you can set it in the Package.appxmanifest . In the previous version of Windows Phone (Windows Phone 8) , you can set it in the XAML page with the property SupportedOrientations=”Landscape” for the phone:PhoneApplicationPage element.

In Windows Phone 8.1 , you need to set this in the Package.appxmanifest file.

How to Set Supported Orientations in Windows Phone 8.1 ?

1. Double click on the Package.appxmanifest from the solution explorer .
2. In the Application tab , selected the supported orientations from the Checkboxes available under “Supported Rotations“. The possible options includes

  • Landscape
  • Portrait
  • Landscape-Flipped

image

3. Save the Project and build it.

How to Change the Orientation of the Page in Windows Phone 8.1 App ?

To change the orientation of the page in the Windows Phone 8.1 app , the developers can set the DisplayInformation.AutoRotationPreferences with one of the values from the DisplayOrientations enum .

async private void Button_Click(object sender, RoutedEventArgs e)
{
   Windows.Graphics.Display.DisplayInformation.AutoRotationPreferences = Windows.Graphics.Display.DisplayOrientations.Portrait;

}

Leave A Reply

Your email address will not be published. Required fields are marked *

You May Also Like

In this post, you will learn about sync provider notifications in Windows 11 and how to disable or enable it...
In this tutorial, let’s learn how to enable or disable the startup sound in Windows 11. By default, when Windows...
The CameraCaptureTask allows the Windows Phone 7 App to launch the Camera Application . This will be useful when the...