iOS7 UIModalTransitionStyleFlipHorizontal bounces after transition

后端 未结 6 1870
一整个雨季
一整个雨季 2020-12-22 18:07

I\'m updating my app for iOS 7 and I discovered a weird problem. I\'m presenting a UIViewController wrapped in a UINavigationController with UIModalTransitionStyleFlip

6条回答
  •  情书的邮戳
    2020-12-22 18:19

    I had the same issue and could "solve it" (it's not a real solution to the problem but it looks fine :) ). The trick is present the view controller using pushViewController/popViewController with an UIView animation to make a flip. Here is a example code to present the view controller:

    UIViewController *viewController = [[UIViewController alloc] init];
    [UIView transitionWithView:self.navigationController.view 
                      duration:0.5 
                       options:UIViewAnimationOptionTransitionFlipFromLeft 
                    animations:^{
                       [self.navigationController pushViewController:viewController animated:NO];
                    }
                    completion:nil];
    

    To dismiss it:

    [UIView transitionWithView:self.navigationController.view 
                      duration:0.5 
                       options:UIViewAnimationOptionTransitionFlipFromRight 
                    animations:^{
                       [self.navigationController popViewControllerAnimated:NO];
                    }
                    completion:nil];
    

    If you don't want the navigationBar on the pushed controller just call [self.navigationController setNavigationBarHidden:YES animated:NO] in viewWillAppear. I hope this approach help you.

提交回复
热议问题