Tuesday, February 10, 2009

iPod Touch/ iPhone Rotation

Rotation code for iPod Touch/iPhone. This is more of a thing you need to know that it exists, because it simply requires a few lines of code. This gets added to your UIViewController class which controls the View. Not very exciting except that it allows the program to be used in portrait or horizontal mode from any direction, even upside down. I still need to figure how to configure the view afterward, but at least the question of how it is done is answered. This is from the WhichWayIsUp app.

-(BOOL)shouldAutorotateToInterfaceOrientation:
(UIInterfaceOrientation)interfaceOrientation {
return YES;
}

No comments:

Post a Comment