【问题标题】:navigation bar is missing after seguesegue 后导航栏不见了
【发布时间】:2017-10-10 20:46:32
【问题描述】:

我有一个表格视图控制器,其中我有一个附加到标题的搜索栏。

tableView.tableHeaderView = searchController?.searchBar

当我在搜索栏中输入单词时,我的帖子会从 Firebase 检索并显示在另一个名为 segueTableViewController 的表中

 let locationSearchTable = UIStoryboard(name: "MainPage", bundle: nil).instantiateViewController(withIdentifier: "SegueTableViewController") as! SegueTableViewController
        searchController = UISearchController(searchResultsController: locationSearchTable)
        searchController?.searchResultsUpdater = locationSearchTable

当我单击 segueTableViewController 中的单元格时,它会将我转到详细页面,但此页面没有导航栏。但是,当我从另一个页面转到详细页面时,它有一个导航栏。几个月来我一直试图找出原因,但我做不到。

override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        if segue.identifier == "GOTOPOST" {

            if let IndexPaths = self.followUsersTableView.indexPathForSelectedRow {

                self.navigationController?.isNavigationBarHidden = false

                let vc = segue.destination as! BookDetailsViewController
}}}

【问题讨论】:

  • 故事板中你的 segue 的呈现类型是什么?连接视图控制器的线的中心应该有一个圆圈,中间有一个代表类型的图标。
  • @Callam show segue
  • 好的,请您添加您的故事板的屏幕截图,包括导航控制器,以及执行转场的代码吗?
  • 这可能是一个错误吗?我也有同样的问题。

标签: ios swift firebase firebase-realtime-database


【解决方案1】:

请添加故事板关系(显示)。并且情节提要添加标识符值“SegueTableViewController”。导航控制器应该在搜索故事板引用中

【讨论】:

  • 这就是我最初所做的
  • 导航控制器应该在搜索故事板引用中
  • 试试这个代码 "self.navigationController?.setNavigationBarHidden(false, animated: true)" add viewWillDisappear
  • 我也有这个
  • 搜索参考中有 navigationControl 吗?
猜你喜欢
  • 1970-01-01
  • 2018-06-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-03-19
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多