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’ll learn about the Win32 Error “0x000019E5 – ERROR_COULD_NOT_RESIZE_LOG” that you get when debugging system erors in...
In this post, you’ll learn about the error “CO_E_DBERROR 0x8004E02B” that is returned when working with COM based APIs or...
In this post, you’ll learn about the Win32 Error “0x000019D0 – ERROR_LOG_BLOCK_VERSION” that you get when debugging system erors in...