我有以下设置:
UINavigationController > TabBarController -> ViewController
这是使用Swift3和Xcode8。
当我执行self.title时,它不起作用。我不能做任何其他方式,尝试以下方法:
self.tabBarController!.navigationItem.title = "test"
self.tabBarController!.navigationController?.title = "test"
self.tabBarController!.navigationController?.topViewController?.title = "test"我做错了什么??
发布于 2016-10-02 02:07:20
答案是:
self.tabBarController!.navigationController!.navigationBar.topItem!.title = "Profile"发布于 2016-09-15 06:22:06
我想如果你的设置是这样的:
TabBarController -> UINavigationController -> ViewController
然后只需编码:
self.navigationItem.title = "test"
self.navigationController?.title = "test"
self.navigationController!.navigationBar.topItem!.title = "test"
self.navigationController?.topViewController?.title = "test"https://stackoverflow.com/questions/39500271
复制相似问题