UINavigationController推送Segue在iOS11中不起作用,没有后退按钮,没有标题

时间:2017-10-30 19:55:12

标签: ios swift uinavigationcontroller storyboard ios11

我有一个tabbar navigation controller,当我向视图提供一个新的故事板navigation controller作为它的初始控制器。

enter image description here

let storyboard = UIStoryboard.init(name:"AccountMenu", bundle: nil)
let viewController = storyboard.instantiateViewController(withIdentifier:"AccountMenuRootVC") as! AccountMenuRootVC
present(viewController, animated: true, completion: nil)

enter image description here

结果在ios 10中按预期工作

enter image description here

但在ios 11中,导航控制器无法正常工作。

看起来初始导航控制器停留在那里并且没有更新。

enter image description here

我也试过添加这个,但没有运气

if #available(iOS 11.0, *) {
    tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentBehavior.never
    self.navigationController?.navigationBar.prefersLargeTitles = false
    self.navigationItem.largeTitleDisplayMode = .never
}

有什么建议吗?

1 个答案:

答案 0 :(得分:0)

与往常一样,答案在其他地方,登录后我的初始segue是自定义segue

https://github.com/oyvind-hauge/OHCircleSegue/blob/master/OHCircleSegue/OHCircleSegue.swift

结果<Account SalesTerritory="T1" SalesDivision="D1"> <Address Zip="12345" State="MO" City="ST LOUIS"/> <Order Amount="100" Date="08/29/17"></> </Account> 函数从未被调用过 但 CAAnimationDelegate 正在替换视图,因此将以下内容添加到自定义segue解决了这个问题。

window?.insertSubview(destView!, aboveSubview: sourceView!)