in iOS7, rarely but occassionally, when I rotate my app while a UIAlertView
is showing, only the alertView and the status bar rotate, and not my app. Has anybod
I had the opposite problem. My app would rotate but the alert view would not rotate. I found out that this was because I was showing the alert view immediately after a UIActionSheet
was dismissed (so while it's dismissal animation was taking place). This seemed to be triggering a bug that will make the alert view not rotate with the app (and some other minor visual problems later). I solved this by presenting the alert view a half second after the action sheet begins to dismiss, like this:
[alertView performSelector:@selector(show) withObject:nil afterDelay:0.5];
I've resolved this issue by adding the next method to app delegate:
- (void)application:(UIApplication *)application willChangeStatusBarOrientation:(UIInterfaceOrientation)newStatusBarOrientation duration:(NSTimeInterval)duration {
NSArray *windows = [application windows];
for (UIWindow *nextWindow in windows) {
[[nextWindow.rootViewController class] attemptRotationToDeviceOrientation];
}
}
I think the root of the problem in iOS7 that Apple changed the UIAlertView appearance mechanism. From now any show of alertView follows after initiating of two private view controllers
_UIModalItemAppViewController
_UIModalItemsPresentingViewController
In other words, now UIAlertView is not a pure view - it is a part of some complicated collection of view controllers with full view controller life cycle.