Navigation bar has wrong position when modal a view controller with flip horizontal transition in iOS 7

我的梦境 提交于 2019-11-28 16:14:16

I have the same problem with you. I think It's a bug with UIKit on iOS 7.

I added a little of code at viewWillAppear method on presentation

     [self.navigationController.navigationBar.layer removeAllAnimations];

When I dismiss this view, I added:

-(IBAction)btnDonePressed:(id)sender {
    [UIView transitionWithView:self.navigationController.view
                      duration:0.75
                       options:UIViewAnimationOptionTransitionFlipFromLeft
                    animations:nil
                    completion:nil];
    [self dismissViewControllerAnimated:YES completion:nil];
}

This worked for me. Hope this helps you.

Instead of hacking [navigationBar.layer removeAllAnimations];, something like this should work as well:

[UIView transitionWithView:self.view.window duration:FlipDuration options:UIViewAnimationOptionTransitionFlipFromLeft animations:^{
    [UIView performWithoutAnimation:^{
        [self presentViewController:modalController animated:NO completion:nil];
    }];
} completion:nil];
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!