uiinterfaceorientation
How to change the device orientation programmatically in iOS 6 [duplicate]
Here are my “five cents”, tested on iOS7 with ARC [[UIDevice currentDevice] setValue: [NSNumber numberWithInteger: UIInterfaceOrientationPortrait] forKey:@”orientation”]; This doesnt generate “leak” warning as performSelector will. UIAlertView – with this code, when you open UIAlertView during view(will/Did)appear you will notice that all but this view is in portrait (apple, really?) I wasn’t able to force the … Read more
RootViewController animation transition, initial orientation is wrong
I looked into this just now because I kept getting the same issue. I randomly tried the following, and it worked perfectly: [UIView transitionWithView:window duration:0.5 options:UIViewAnimationOptionTransitionCrossDissolve animations:^(void) { BOOL oldState = [UIView areAnimationsEnabled]; [UIView setAnimationsEnabled:NO]; [(ICApp *)sharedApplication.delegate window].rootViewController = self; [UIView setAnimationsEnabled:oldState]; } completion:nil]; I know it’s a bit odd to disable/enable animations inside an … Read more
iOS: Device orientation on load
EDIT: I mis-read your question. This will allow you to start your application in certain orientations. Just realized you’re trying to figure out the orientation on launch. There is a method to check the status bar orientation on UIApplication: [[UIApplication sharedApplication] statusBarOrientation]; Original answer Try setting the application’s accepted device orientations in the plist file: … Read more
Launching into portrait-orientation from an iPhone 6 Plus home screen in landscape orientation results in wrong orientation
I had the same issue when launching our app in landscape on an iPhone 6 Plus. Our fix was to remove landscape supported interface orientations from the plist via project settings: and implement application:supportedInterfaceOrientationsForWindow: in the app delegate: – (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window { return UIInterfaceOrientationMaskAllButUpsideDown; } Apparently the information in your plist is to … Read more
What is the “right” way to handle orientation changes in iOS 8?
Apple recommends using size classes as a coarse measure of how much screen space is available, so that your UI can significantly change its layout and appearance. Consider that an iPad in portrait has the same size classes as it does in landscape (Regular width, Regular height). This means that your UI should be more … Read more
Is [UIScreen mainScreen].bounds.size becoming orientation-dependent in iOS8?
Yes, it’s orientation-dependent in iOS8, not a bug. You could review session 214 from WWDC 2014 for more info: “View Controller Advancements in iOS 8” Quote from the presentation: UIScreen is now interface oriented: [UIScreen bounds] now interface-oriented [UIScreen applicationFrame] now interface-oriented Status bar frame notifications are interface-oriented Keyboard frame notifications are interface-oriented