Graphics Programs Reference
In-Depth Information
Forcing Landscape Mode
If your application only makes sense in landscape mode, you can force it to run that way.
First, in your view controller implement
shouldAutorotateToInterfaceOrient-
ation:
to only return
YES
for landscape orientations.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)x
{
return UIInterfaceOrientationIsLandscape(x);
}
An application's
Info.plist
contains a key-value pair that specifies the valid initial ori-
entations of the application. Select the project from the project navigator, then the
HeavyRotation
target from the editor area, and finally the
Summary
pane.
Figure 8.12 Choosing the initial orientations
Find a section in the target's summary called
Supported Device Orientations
. This section
contains four toggle buttons that specify which orientations are allowed. Buttons that are
pushed in are valid.