Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

5: Developing for Multiple Screen Sizes > HANDLING DEVICE ORIENTATION

HANDLING DEVICE ORIENTATION

Next take a look at how you can receive notifications for an update in device orientation. These events are triggered when a user manually changes the orientation of a device, between landscape and portrait.

In the AIR Application Descriptor file, one of the settings found in the <initialWindow> node is the <autoOrients> property, as shown in the following snippet:

<autoOrients>true</autoOrients>

This tells the mobile application whether to allow auto orientation. Here it is set to true, and so the application's content can rotate. When this is set to false, the application will be prevented from rotating its content, and, in turn, will stay in its initial aspect ratio. So, if an application is initialized with the stage width set less than the stage height, that is, portrait, it will remain like this even when a user rotates the device.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint