iOS7 UIModalTransitionStyleFlipHorizontal bounces after transition

后端 未结 6 1869
一整个雨季
一整个雨季 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

    For both the presenting and the presented view controller I have a UITableViewController within UINavigationController, both configured using Auto Layout. I noticed that the other answers didn't solve the problem that on dismiss the tableView of the presenting view controller jumps 20 pt vertically.

    This solution addresses this problem.

    In the presented view controller (as proposed by Ben Packard):

    - (void)viewWillAppear:(BOOL)animated {
        [super viewWillAppear:animated];
        [self.navigationController.navigationBar.layer removeAllAnimations];
    }
    

    In the presenting view controller (as proposed in part by dusty):

    - (void)viewWillLayoutSubviews{
        if (self.navigationController.presentedViewController) {
            [self.navigationController.navigationBar.layer removeAllAnimations];
            [self.tableView.layer removeAllAnimations];
        }
        [super viewWillLayoutSubviews];
    }
    

提交回复
热议问题