UIDEVICE orientation
Asked Answered
D

2

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

Debus answered 2/6, 2010 at 4:51 Comment(1)
See also iPhone orientationSelfgratification
B
8

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

Baldpate answered 2/6, 2010 at 5:0 Comment(0)
F
2

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.

Fritzsche answered 2/6, 2010 at 4:54 Comment(2)
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 answerDebus
ok thank you very much for your valuable advice i will follow this guidlineDebus

© 2022 - 2024 — McMap. All rights reserved.