I am developing an application in portrait mode.In my one view controller when I click on table view another view opened in portrait mode.I want it to be opened in landscape mode. Please suggest me how to do this. Thanks in advance!!
Asked
Active
Viewed 802 times
3
-
Have you solved your problem or not ???? – SJS Apr 22 '11 at 13:23
3 Answers
1
As far as I know, the only way to achieve this is to to show the view controller as a modal with
[self presentModalViewController:landscapeViewController animated:YES];
and specify the landscape mode in
-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return UIInterfaceOrientationLandscapeLeft == interfaceOrientation;
}
This is because if a modal view can appear in only one orientation, the app automatically rotates to that orientation.
See the accepted answer for this question for more details: Transitioning to landscape rotation within a uinavigationcontroller
0
I think that'l do:
[[CCDirector sharedDirector] setDeviceOrientation: kCCDeviceOrientationLandscapeRight];
Im not sure though...

JJgendarme
- 1,411
- 2
- 16
- 30
0
I'm pretty sure you cannot use setOrientation
anymore, since it is deprecated and apps have been declined for using it.
This may be an option for you:
http://www.iphonedevsdk.com/forum/iphone-sdk-development/33548-alternative-setorientation.html
It rotates the view using a transformation.