1

I'm working with Navigational Controller and I want to remove the title of the previous page that is on the NavigationalBar like this:-

enter image description here

tryKuldeepTanwar
  • 3,350
  • 2
  • 17
  • 47

3 Answers3

2

You can remove navigation title from NavigationBar with this line of code:

[self.navigationItem.backBarButtonItem setTitle:@" "];

Hope it would help you.

Bhumika
  • 876
  • 7
  • 20
2

1

You can also change it with this line of code:

[self.navigationItem.backBarButtonItem setTitle:@"Title here"];

if you like to set back button title is blank...then just instead of Title here put there only space

2

or do like this:

UIBarButtonItem *btn = [[UIBarButtonItem alloc]init];
btn.title=@"";
self.navigationItem.leftBarButtonItem=btn;

3

Select navigation item from interface builder and change the Back Button string to what you'd like the back button to appear as. If you want it blank then just put a space.

For title color

1

    NSDictionary *titlecolor =@{
NSForegroundColorAttributeName : [UIColor whiteColor]
                               };

Assign the dictionary

    [[self navigationItem] setTitle:@"Your Title"];
self.navigationController.navigationBar.titleTextAttributes = titlecolor;

2

Suppose you want redColor

self.navigationController.navigationBar.titleTextAttributes = [NSDictionary dictionaryWithObject:[UIColor redColor] forKey:NSForegroundColorAttributeName];

For Background Color

[[UINavigationBar appearance] setTintColor:[UIColor colorWithRed:107.0/256.0 green:145.0/256.0 blue:35.0/256.0 alpha:1.0]]; 
Suraj Sukale
  • 1,734
  • 1
  • 10
  • 18
1

You need to set empty title for your navigation bar item button title You can try this

[self.navigationItem.backBarButtonItem setTitle:@" "];

OR

You can also assign a new button to your navigation bar item button

UIBarButtonItem *myButton = 
        [[UIBarButtonItem alloc] initWithTitle:@" " 
                                         style:UIBarButtonItemStyleBordered 
                                        target:nil 
                                        action:nil];
[[self navigationItem] setBackBarButtonItem:myButton];
Bhumika
  • 876
  • 7
  • 20
hites
  • 149
  • 1
  • 7
  • i found this working but it removed the back button any suggestion on that-""UIBarButtonItem *btn = [[UIBarButtonItem alloc]init]; btn.title=@""; self.navigationItem.leftBarButtonItem=btn;"" – tryKuldeepTanwar Jun 07 '16 at 06:41
  • Here you have assigned a new button so, you need to make a method and call that method on the target of this(myButton) button. – hites Jun 07 '16 at 06:48
  • how am I suppose to make that back button appear? @hites – tryKuldeepTanwar Jun 07 '16 at 06:50