IOS:导航栏在推送 segue 后消失

标签 ios swift uinavigationcontroller uinavigationbar uinavigationitem

stroyboard

每次我执行 show(push) segue 时,文章 VC 都没有显示标题或后退按钮的导航栏。我还检查了导航 Controller 是否有标题,因为这似乎是某些情况下的解决方案。执行 segue 的类只是发送信息。 Categories 是一个枚举。

enter image description here

最佳答案

您必须用另一个 NavigationController 包装您的 articleVC。 或者不使用 segue,您可以使用导航 Controller 推送它以重用 NavigationBar。

let yourArticleViewController = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "articleViewControllerIdentifier") as! ArticleViewController
self.navigationController?.pushViewController(yourArticleViewController, animated: true)

关于IOS:导航栏在推送 segue 后消失,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42262487/

相关文章:

c# - 在 Xamarin ios 中显示不同样式(列表、网格、 block )的项目?

ios - 检查在 UITableView 的每个部分中是否至少选择了一个单元格

ios - 导航 Controller 后退按钮标题显示上一个标题

iphone - 如何在某些 View 上使用图像更改 UINavigationBar 背景,但不是全部?

ios - 长按结束 swift sprite kit 时如何运行函数

iphone - UIActivityIndi​​cator 未显示在 webview 顶部

ios - 如何修复非法配置?

Swift XMLParser//根据元素&属性选择节点

ios - CBPeripheral setNotifyValue WithResponse 不调用 didWriteValueForCharacteristic

ios - 如何从主视图 Controller 在详细 View Controller 中推送新 View ?