It is sometimes desirable to constrain your application layout to a specific aspect ratio, landscape, or portrait. When building Android projects using the Flex framework, it is a simple matter to accomplish this.
We can freeze a particular aspect ratio for our application by modifying the AIR application descriptor file:
1. By default, when we define a new Flex mobile project, an application descriptor
XML
file is created. This file includes a node dedicated to the applicationinitialWindow
configuration. It will appear similar to the following code:<initialWindow> <autoOrients>true</autoOrients> <fullScreen>false</fullScreen> <visible>true</visible> <softKeyboardBehavior>none</softKeyboardBehavior> </initialWindow>
2. We want to modify the contents of this node in two ways. First, set the
autoOrients
tag tofalse
. This will prevent the application from re-orienting...