PDA

View Full Version : Easy way to do this




arnieterm
Nov 26, 2009, 09:00 AM
For an iphone application, i need to show a screen when the user makes the device landscape and pop this screen when the user makes the device as portrait. I am making use of below given method for doing this

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation{

Is there any other way to force a screen out of several as Landscape and rest other as portrait without using the above given method.
Thanks
Arnieterm



ghayenga
Nov 26, 2009, 12:58 PM
For an iphone application, i need to show a screen when the user makes the device landscape and pop this screen when the user makes the device as portrait. I am making use of below given method for doing this

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation{

Is there any other way to force a screen out of several as Landscape and rest other as portrait without using the above given method.
Thanks
Arnieterm

shouldRotate allows you to prevent it from rotating the screen by returning NO or allow it by returning YES.

The willRotate or didRotate versions are what you need to use to make the changes before or after it has rotated.

There is no way to force it to rotate from one to the other programmatically if that's what you're asking.