Time for action – restricting the orientation of your app (iPhone)
This example shows how you can specify the orientation for an iPhone app. Perform the following steps:
Open
tiapp.xml
.Look for the following code:
<iphone> <orientations device="iphone"> <orientation>Ti.UI.PORTRAIT</orientation> </orientations> <orientations device="ipad"> <orientation>Ti.UI.PORTRAIT</orientation> <orientation>Ti.UI.UPSIDE_PORTRAIT</orientation> <orientation>Ti.UI.LANDSCAPE_LEFT</orientation> <orientation>Ti.UI.LANDSCAPE_RIGHT</orientation> </orientations> </iphone>
This code restricts your app to portrait mode on an iPhone, but allows other orientations on iPad.
What just happened?
You can change the orientations by making modifications to tiapp.xml
. The available orientations to choose from are Ti.UI.PORTRAIT
(home...