Navigation bar gets adjusted after calling completeTransition: in custom transition

后端 未结 4 1016
温柔的废话
温柔的废话 2020-12-16 12:34

My goal is to provide zooming modal transition from for the user from a view similar as springboard icons zoom in when launching apps.

The presented view controller

4条回答
  •  忘掉有多难
    2020-12-16 13:23

    This is still a hack, based on Ondřej Mirtes' one but it works better if you have an in-call status bar and you're on iOS8

    if([toViewController isKindOfClass:[UINavigationController class]]) { 
      UINavigationController *navCtrl = (UINavigationController *)toViewController;
      UINavigationBar *navBar = navCtrl.navigationBar;
      if(navBar.frame.origin.y == 0 && navBar.frame.size.height == 44) {
        navBar.frame = CGRectMake(0, 0, navBar.frame.size.width, fmin(44 + [UIApplication sharedApplication].statusBarFrame.size.height, 64)); 
      }
    }
    

    Remains ugly though :/

提交回复
热议问题