[英]UINavigationController Push Segue doesn't work in iOS11, No back button, No title
I have a tabbar
with a navigation controller
, when I present a new storyboard to the view a navigation controller
as it's initial controller. 当我向视图呈现一个新的情节提要板时,我有一个带有
navigation controller
的tabbar
,它是navigation controller
的初始控制器。
let storyboard = UIStoryboard.init(name:"AccountMenu", bundle: nil)
let viewController = storyboard.instantiateViewController(withIdentifier:"AccountMenuRootVC") as! AccountMenuRootVC
present(viewController, animated: true, completion: nil)
Result works as expected in ios 10 结果按预期在ios 10中工作
But in ios 11, navigation controller doesn't work. 但是在ios 11中,导航控制器不起作用。
Looks like initial navigation controller stuck up there and doesn't update. 看起来最初的导航控制器卡在了那里并且没有更新。
I have also tried adding this, but no luck 我也尝试过添加,但是没有运气
if #available(iOS 11.0, *) {
tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentBehavior.never
self.navigationController?.navigationBar.prefersLargeTitles = false
self.navigationItem.largeTitleDisplayMode = .never
}
Any suggestions? 有什么建议么?
As always, answer was in somewhere else, My initial segue after login was a custom segue 和往常一样,答案在其他地方,登录后我最初的设定是自定义设定
https://github.com/oyvind-hauge/OHCircleSegue/blob/master/OHCircleSegue/OHCircleSegue.swift https://github.com/oyvind-hauge/OHCircleSegue/blob/master/OHCircleSegue/OHCircleSegue.swift
turns out CAAnimationDelegate
functions were never called but window?.insertSubview(destView!, aboveSubview: sourceView!)
was replacing the view so adding the following to custom segue solved the issue. 原来从未调用过
CAAnimationDelegate
函数,但是window?.insertSubview(destView!, aboveSubview: sourceView!)
正在替换视图,因此将以下内容添加到自定义segue中解决了该问题。
func animationDidStop(_ anim: CAAnimation, finished flag: Bool) {
source.present(destination, animated: false, completion: nil)
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.