[Windows Phone 7] UI adaptive screen processing

Source: Internet
Author: User

The default portrait mode for the Silverlight project of WP7 and the default xNa project is Landscape mode. To change the initial mode, you can change the supportedorientations attribute on the phoneapplicationpage.

The supportedorientations attribute has three enumerated values: Landscape (horizontal direction supported), portrait (vertical direction supported), and portraitorlandscape (horizontal and vertical direction supported ).

You can also use vs to add a horizontal or vertical page.

To respond to screen changes, the UI can handle the changes through the orientationchanged event of phoneapplicationpage, and determine the direction of the current mobile phone through the orientationchangedeventsargs type parameter E's orientation value. The value of orientation is the enumerated value of pageorientation.

The following table lists the definitions of pageorientation enumeration:

 // Summary: // an enumeration defining the possible orientations of a page. public Enum pageorientation {// Summary: // No orientation is specified. none = 0, // Summary: // portrait orientation. portrait = 1, // Summary: // landscape orientation. landscape = 2, // Summary: // portrait orientation. portraitup = 5, // Summary: // portrait orientation. portraitdown = 9, // Summary: // landscape orientation with the top of the page rotated to the left. landscapeleft = 18, // Summary: // landscape orientation with the top of the page rotated to the right. landscaperight = 34,} 
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.