当前位置: 动力学知识库 > 问答 > 编程问答 >

swift - Going from ViewController -> DetailViewContoller ->ViewController and Navigation Item is empty?

问题描述:

I am not sure what is happening. When i browse from ViewController to DetailViewController and with the back button to ViewController again, the navigation item "Title main" is empty or seems to be empty??

I also tried

 override func viewDidLoad() {

super.viewDidLoad()

self.title = "Title main"

A/ On main view controller I see the title item

B/ Navigation item title is empty on return??

网友答案:

Try setting the title in:

override func viewWillAppear(animated: Bool) {
    navigationItem.title = "Title main"
}

Let me know if that helps

分享给朋友:
您可能感兴趣的文章:
随机阅读: