我正在使用自定义转换来模态显示 UINavigationController 内的 UIViewController。我正在使用缩放过渡,该过渡以较小的框架开始,以 UINavigationController 全屏结束。
toView.transform = CGAffineTransformMakeScale(kInitialScale, kInitialScale);
[containerView addSubview:toView];
[UIView animateWithDuration:duration animations: ^{
toView.transform = CGAffineTransformMakeScale(1.0, 1.0);
} completion: ^(BOOL finished) {
[transitionContext completeTransition:![transitionContext transitionWasCancelled]];
}];
我的问题是 UINavigationController 是使用导航栏创建的,该导航栏没有考虑状态栏(比应有的小),并且仅在达到全屏尺寸时才进行调整(从 44 到 64px)。导航标题在动画末尾偏移。
知道如何避免标题的最终偏移并从一开始就创建具有良好导航栏尺寸的导航 Controller 吗?
最佳答案
在转换之前将 toView 添加到 containerView 中就可以了。
关于ios - UINavigationController自定义模态转换,导航栏太小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27515419/