Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Swift 快速后退按钮未显示在UINav栏中_Swift - Fatal编程技术网

Swift 快速后退按钮未显示在UINav栏中

Swift 快速后退按钮未显示在UINav栏中,swift,Swift,我的Swift代码中有这个简单的代码 let PostPage = PostView() navigationController?.pushViewController(PostPage, animated: true) class PostView: UIViewController 这段代码做了它应该做的,也就是显示PostView,但是当显示这个视图时,我希望UINavbar的标题会被更改,并且会显示back按钮。但这一切都不会发生 在AppDelegate中 window?.

我的Swift代码中有这个简单的代码

let PostPage = PostView()
navigationController?.pushViewController(PostPage, animated: true)

class PostView: UIViewController 
这段代码做了它应该做的,也就是显示
PostView
,但是当显示这个视图时,我希望UINavbar的标题会被更改,并且会显示back按钮。但这一切都不会发生

在AppDelegate中

window?.rootViewController = UINavigationController(rootViewController: TabNavigator())

看起来您正在将rootViewController从NavigationController更改为ViewController

let homeTab = UINavigationController(rootViewController:HomePage())
self.viewControllers = [homeTab]

因此,rootViewController不再是navigationController。

看起来您正在将rootViewController从navigationController更改为ViewController

let homeTab = UINavigationController(rootViewController:HomePage())
self.viewControllers = [homeTab]

因此,rootViewController不再是navigationController。

出现了什么?@NRitH PostView with uinavBar推之前显示了什么VC?我在其中调用的VC
let PostPage=PostView()navigationController?.pushViewController(PostPage,动画:true)
在按下PostView控制器之前,您是否可以共享您正在执行的操作代码。还有推之前+推之后的屏幕截图?显示了什么?@NRitH PostView with uinavbar推之前显示了什么VC?我在其中调用的VC
let PostPage=PostView()navigationController?.pushViewController(PostPage,动画:true)
您可以分享推后视图控制器之前正在执行的代码吗。还有推前+推后的屏幕截图?
let homeTab = UINavigationController(rootViewController:HomePage())
self.viewControllers = [homeTab]