Back button not appearing on UINavigationController

后端 未结 5 608
抹茶落季
抹茶落季 2021-01-05 18:39

I have a UINavigationController setup in my AppDelegate:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSD         


        
5条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-05 19:31

    You must think of the navigation controller as a stack of navigation controllers each controlling one screen full of information. You instantiate the navigation controller with the

    -(id)initWithRootViewController:(UIViewController *)rootViewController
    

    method. You specify the root view controller in this call. Then you add the navigation controller's view as a subview to the window, like you did before.

    If you want to show your second screen you push another view controller on the stack by using

    -(void)pushViewController:detailViewController animated:YES
    

    method.

提交回复
热议问题