views:

412

answers:

2

hello all i have my splash screen which i want to show in landscape mode and all other screen in potrait mode. My root view controller is acting as a splash screen i am writing this code in viewdidload method

[[UIDevice currentDevice] setOrientation:UIInterfaceOrientationLandscapeRight]; 

But this code is not working and shows me that UIdevice may not respond to setorentation please guide me that how could i change the orentation for only first splash screen and also other screen should be in potrait mode

+2  A: 

Can't you just have a splash screen that is displayed sideways?

The user will interpret that as a "landscape" splash and adjust accordingly, whether or not your application actually thinks it is. Just make sure to return NO in shouldAutorotateToInterfaceOrientation: so it doesn't rotate away when the user turns it.

But a warning: it's probably worthwhile to tweak your splash screen so it is in the portrait orientation, since it may be annoying to suggest to the user that your app likes landscape, and then switch to portrait as soon as it actually starts.

If you really want to, though, you can use setStatusBarOrientation:animated: on the UIApplication to force the orientation.

Chris Cooper
yes i can do that but i just need to confirm that if there is any other standard way to set device orientation for a particular screen which would not effect the other screen? if it is there that would be great thank you very much for your answer
hardik
ok thank you very much for your valuable advice i will follow this guidline
hardik
@hardik: You're welcome. Good luck.
Chris Cooper
+2  A: 

UIDeviceOrientation refers to the physical orientation of the device whereas UIInterfaceOrientation refers to the orientation of the user interface. You can't change the physical orientation of the device, but you can change how the status bar is displayed via [UIApplication sharedApplication].statusBarOrientation

rpetrich