我正在使用 didDeselectRowAtIndexPath
浏览不同的 Storyboard,例如:
func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
let story = ["News","Video","Twitter","Request Info","More"]
let vc = self.storyboard?.instantiateViewControllerWithIdentifier(story[indexPath.row]) as NewsFeedTableViewController
self.presentViewController(vc, animated: true, completion: nil)
}
但是,当我使用此功能时,导航栏
没有显示。但是,当我使用 segue 时,Navigation Bar
出现了。
现在的问题是:
Cells
不能继续超过 1 个 Storyboard- 需要导航栏在应用程序中滚动(这似乎需要
Segue
)
tableView
中的 有什么解决办法吗?
最佳答案
您正在使用 presentViewController
,这就是您没有获得 NavigationBar 的原因,它以模态方式呈现 View 。而不是像这样的 pushViewController
:
self.navigationController?.pushViewController(vc, animated: true)
可能在您的 Storyboard中,segue 类型将是 push
,这就是您获得导航栏的原因。
您可能对以下内容感兴趣:
关于ios - Segue VS didDeselectRowAtIndexPath,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27885401/