Back button not appearing on UINavigationController

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

I have a UINavigationController setup in my AppDelegate:

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


        
5条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-05 19:33

    Try this:

    DetailViewController *detailViewController = [[DetailViewController alloc] init];
    UIBarButtonItem *back = [[UIBarButtonItem alloc] initWithTitle : @"Back"
                                                             style : UIBarButtonItemStyleDone
                                                            target : nil
                                                            action : nil];
    self.navigationItem.backBarButtonItem = back;
    [self.navigationController pushViewController : detailViewController animated : YES];
    [detailViewController release];
    

提交回复
热议问题