开发者

how to change back button title of navigation in iphone

开发者 https://www.devze.com 2023-03-11 13:20 出处:网络
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 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";

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号