简体   繁体   English

NavigationController.PushViewController也会移动导航栏

[英]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.

相关问题 navigationController.pushViewController方法返回未定义 - navigationController.pushViewController the method returns undefined 如何在UITableViewSource下访问NavigationController.PushViewController? - How to access NavigationController.PushViewController under UITableViewSource? MonoTouch: UITableViewController,NavigationController 在 NavigationController.PushViewController 之后是 null - MonoTouch: UITableViewController,NavigationController is null after NavigationController.PushViewController 如果在mainQueue / mainThread之外运行,NavigationController.pushViewController崩溃 - NavigationController.pushViewController crashes if run outside of mainQueue/mainThread navigationController.pushViewController 似乎在 Xcode 11 中不起作用? - navigationController.pushViewController doesn't seem to work in Xcode 11? 工具栏作为NavigationController中的子导航栏 - Toolbar as sub navigation bar in NavigationController iOS NavigationController隐藏导航栏 - iOS NavigationController hide the navigation bar iPhone pushViewController 保留导航栏的右侧部分 - iPhone pushViewController keep the right part of navigation bar 在pushViewController时禁用导航栏透明度 - Disable navigation bar transparency while pushViewController PushViewController并设置导航栏的颜色和标题 - PushViewController & set navigation bar color and title
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM