UIAlertview is displayed in portrait mode when the screen is in landscape mode

I have an application that is configured only to support Portrait mode. But I have to show one screen (say abcViewController) in my application in landscape mode. When the abcViewController screen is pressed, the orientation changes from Portrait to landscape mode. In this status of the abcViewController screen, all images, buttons are displayed in landscape mode, but the UIAlertView is displayed in PortraitMode. This means that everything that is displayed on the screen changes in landscape mode in abcViewController, but the UIAlertView does not rotate in landscape mode and remains in portrait mode. I would like UIAlertView to follow the rules of the containing view controller and show the same orientation as the statusBar.

enter image description here

. iOS 8.0 Xcode 5.0, , Xcode 5.0

+4
1

, UIView iOS 7 iOS, iOS 8, iOS 8, , :

iOS 7, iOS 8:

UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation];
BOOL landscape = (orientation == UIInterfaceOrientationLandscapeLeft || orientation == UIInterfaceOrientationLandscapeRight);
NSLog(@"Currently landscape: %@, width: %.2f, height: %.2f", 
      (landscape ? @"Yes" : @"No"), 
      [[UIScreen mainScreen] bounds].size.width, 
      [[UIScreen mainScreen] bounds].size.height);

iOS 8:

Currently landscape: No, width: 320.00, height: 568.00
Currently landscape: Yes, width: 568.00, height: 320.00

iOS 7:

Currently landscape: No, width: 320.00, height: 568.00
Currently landscape: Yes, width: 320.00, height: 568.00

[UIScreen mainScreen].bounds.size, iOS8.

iOS 8 iOS 8, .

1. UIAlertController UIAlertView.

2. iOS 8, .

+3

All Articles