Today, let us try to understand a bit about windows phone 7 screen orientation.
So, First Question : What do we mean by Screen or Page Orientation ?
Screen or Page Orientation is the way in which a rectangular page is oriented (aligned or positioned) for normal viewing – Wikipedia
Generally there are two main types of orientation, depending on how a device is held.
- Potrait – when the device is held in standing / vertical position.
- Landscape – when the device is held in lying / horizontal position.
and, the next question : What Screen / Page Orientation does Windows 7 support?
Windows Phone 7 supports 3 types of orientations
- Potrait (vertical, with the screen above the hardware buttons)
- Landscape Left (horizontal, with the screen to the left of the hardware buttons)
- Landscape Right (horizontal, with the screen to the right of the hardware buttons)
The SupportedOrientations property
A Windows Phone 7 application page can support all 3 types of page / screen orientation.
The SupportedOrientations property of a page allows us to specify the kind of orientation that a page can support. This property is present in the .xaml file of every page.
The values that these property can take are :
- Potrait : Supports only potrait orientation.
- Landscape : Supports only Landscape orientation. In this case, both the Landscape orientations i.e Landscape Left and Landscape Right are supported. However, we cannot choose to support only one of the Landscape orientations. If our app works with one of the Landscape orientations, then it has to work for both of them.
- PotraitOrLandscape : Supports all three orientations.
When we set the SupportedOrientations property to PotraitOrLandscape, the page automatically rotates to proper orientation at the appropriate times (based on the angle the user holds their phone and wether a hardware keyboard is activated).
System provided components, such as status bar, application bar, message boxes and other notificiations, adjust automatically.
The Orientation property
The Orientation property present in .xaml file is for design time use only. It is used in design-time, by Expression blend and Visual Studio to display the page in desired orientation.
Setting the Orientation property does not have any effect at runtime.
What orientation should be used when?
If users never need to do any typing inside our app, then it is okay for the app to be potrait only.
For apps, that involve typing, supporting landscape orientations is practically mandatory. The reason for this is that some phones have a landscape-oriented keyboard, and typing on it would not be a a great experience if its orientation doesn’t match the screen’s orientation.
Supporting only landscape is ok for some games and novelty apps, but weird for anything else. However, if such an app involves typing (such as typing username for high score etc), those parts should support the potrait orientation for the sake of phones with potrait-oriented hardware keyboard.
Reference : 101 Windows Phone 7 Apps – Vol 1 (Chapter 3)