2种方式:
1、前者在主视图中
示例:
UIBarButtonItem *temporaryBarButtonItem = [[UIBarButtonItem alloc] init];
temporaryBarButtonItem.title = @"";
self.navigationItem.backBarButtonItem = temporaryBarButtonItem;
[temporaryBarButtonItem release];
2、self.navigationItem.hidesBackButton = YES,后者在子视图中用
示例:
self.navigationItem.hidesBackButton = YES;
UIBarButtonItem *backItem = [[UIBarButtonItem alloc]initWithTitle:@"返回" style:UIBarButtonItemStyleDone target:self action:@selector(backItemClick)];
self.navigationItem.leftBarButtonItem = backItem;