How to hide the “back” button in UINavigationController?

前端 未结 14 2406
盖世英雄少女心
盖世英雄少女心 2020-12-04 07:09

Do you know how to hide the \'back\' button in a UINavigationController? Also, how to show it back, but I guess that\'s very similar to hiding it...

Just like the ma

14条回答
  •  误落风尘
    2020-12-04 08:04

    The solution suggest by Zoran Simic didn't work for me for some reason.

    This code did work however:

    MyController* controller   =   [[MyController alloc]  init];
    NSArray* array             =   [[[NSArray alloc] initWithObjects:controller, nil] autorelease];
    
    [self.navigationController setViewControllers:array animated:NO];
    
    [controller release];
    

    Obviously you'd have to manipulate an NSArray to your taste to make it work for you. Hope that helps somebody :)

提交回复
热议问题