UITabBarController layout is broken when UIViewController is presented with UIViewControllerAnimatedTransitioning and rotated in iOS8

I have a rotation problem in iOS8. In iOS7, this is normal.

Download example: https://www.dropbox.com/s/jr067r3jpzit10h/Rotation.zip?dl=0

Following are the steps.

  • Create an iOS project based on a tab bar in Xcode 6.
  • set device orientations to support Portrait, Landscape Left, Landscape Right in project settings.
  • allows the tab bar controller to maintain portrait only by code. (shouldAutorotate returns true and is supported byInterfaceOrientations returns UIInterfaceOrientationMask.Portrait)
  • represents the view controller from the first view controller in the tab bar, through currentViewController: animated: completion. use a special transition by setting changeingDelegate. (I made a simple transition / deactivate the transition for this), the modal view supports all kinds of orientations. (shouldAutorotate returns true)
  • In model view, rotate the device.
  • reject modal view.
  • the view crashed like this.

enter image description here

Who can help?

+4
source share
2 answers

I have something similar, but I put the TabController in the navigation controller and in my custom navigation controller I will do the following:

- (BOOL)shouldAutorotate {
return self.topViewController.shouldAutorotate;

}

0
source

, . , , , - iOS 8.

- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator {

    UIDevice *device = [UIDevice currentDevice];

    if ([device oka_iOS8] && self.presentingViewController) {
        [super viewWillTransitionToSize:size withTransitionCoordinator:coordinator];
    }

}

iOS8 , , UIDevice.

    BOOL isLessThan9 = [device.systemVersion compare:@"9.0" options:NSNumericSearch] == NSOrderedAscending;

    NSComparisonResult result = [device.systemVersion compare:@"8.0" options:NSNumericSearch];

    BOOL isMoreThanOrEqualTo8 = result == NSOrderedSame || result == NSOrderedDescending;

- .

UINavigationController, viewController.

0

All Articles