我为我的应用程序构建了一个简单的“关于”页面,它只是一个带有本地 HTML 的 webView。我的设置包含在单独的 Storyboard中,而 AboutViewController 是该 Storyboard中的一个 View 。
当 AboutViewController 出现时,它不再显示返回设置的后退按钮。
过去两周一直工作得很好,今天突然停止工作了。有没有更好的方法将 View 推送到导航 Controller 上?
let storyboard = UIStoryboard(name: "Settings", bundle: nil)
let aboutViewController = storyboard.instantiateViewControllerWithIdentifier("AboutViewController") as! AboutViewController
self.navigationController?.pushViewController(aboutViewController, animated: true)
self.tableView.deselectRowAtIndexPath(indexPath, animated: true)
最佳答案
解决方法是自己把它放回去。
override func viewWillAppear(animated: Bool)
{
super.viewWillAppear(animated)
navigationItem.leftBarButtonItem = UIBarButtonItem(title: "< Back", style: UIBarButtonItemStyle.Plain, target: self, action: "back")
}
func back()
{
navigationController?.popViewControllerAnimated(true)
}
关于ios - 后退按钮突然不再出现在导航栏中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32973008/