How to not show Back Bar Button of navigation controller. When I am trying to write my title with " " then this is showing default title name (Root).
How to change i开发者_如何学Ct ?
if you don't want to see the back button, use below
self.navigationItem.backBarButtonItem = nil ;
if you want to see your text
instead of "Back" button. you could also define your action:
.
self.navigationItem.backBarButtonItem =
[[[UIBarButtonItem alloc] initWithTitle:@"MyOwnBackTitle"
style: UIBarButtonItemStyleBordered
target:self
action:@selector(backClicked:] autorelease];
Use below code to change the bar text,
UINavigationBar *bar = self.navigationController.navigationBar ;
bar.topItem.title = @"MY Title";
Use this in the viewDidLoad method
[self.navigationItem setHidesBackButton:YES animated:YES];
self.navigationController.navigationBar.topItem.title=@"Your Title";
精彩评论