Question

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

Was it helpful?

Solution

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

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top