[英]NavigationController.PushViewController moves the navigation bar as well
See the attached GIF image to see the problem. 请参阅随附的GIF图像以查看问题。 Notice that upon tapping the Next button, new controller is pushed and it seems like it pushes new navigation bar on top of the existing one.
请注意,在点击“下一步”按钮时,将按下新的控制器,似乎将新的导航栏推到现有的顶部。 Normally we know only everything under navigation bar moves and navigation bar doesn't.
通常,我们只知道导航栏下的所有内容都会移动,而导航栏则不知道。 I am using NavigationController.PushViewController(controller, true) to push controller.
我正在使用NavigationController.PushViewController(controller,true)来推送控制器。
Is your next view controller is embedded in its own Navigation Controller, if so you should try having one Navigation controller and push the View controller in that. 您的下一个视图控制器是否已嵌入其自己的导航控制器中,如果是,则应尝试使用一个导航控制器,然后将其中的视图控制器推入其中。
UPDATE 更新
let transition:CATransition = CATransition()
transition.duration = 0.7
transition.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
transition.type = kCATransitionPush
transition.subtype = kCATransitionFromRight
self.navigationController!.view.layer.addAnimation(transition, forKey: kCATransition)
self.navigationController?.pushViewController(controller, animated: false)
Transition types: 过渡类型:
kCATransitionFromLeft
kCATransitionFromBottom
kCATransitionFromRight
kCATransitionFromTop
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.