rotation problems when a UIAlertView is showing in iOS 7

前端 未结 3 511
旧巷少年郎
旧巷少年郎 2020-12-28 23:47

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

3条回答
  •  难免孤独
    2020-12-29 00:22

    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];
         }
    }
    

提交回复
热议问题