在viewWillAppear中,我将navigationController和navigationBar隐藏如下:
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
self.navigationController?.setNavigationBarHidden(true, animated: true)
self.navigationController?.interactivePopGestureRecognizer?.delegate = nil
}然后,我在我的Storyboard中添加了一个Storyboard,并将它连接到Storyboard中的IBOutlet中,以便从IB中自定义它。
除了我不能将默认的backButton从原来的隐藏navigatioBar移动到我的新的自定义navigationBar之外,一切都很好。
问题:
有没有办法将backButton从默认的navigationBar移动到这个新的自定义navigationBar**
注意:我不想添加一个定制的后退按钮。
发布于 2017-04-02 23:52:40
你不能。你需要创建你自己的UIBarButtonItem
let backItem = UIBarButtonItem(title: "Back", style: .plain, target: self, action: #selector(yourSelector))
self.navigationItem.leftBarButtonItem = backItemhttps://stackoverflow.com/questions/43174721
复制相似问题