Kuldeep1007tanwar Kuldeep1007tanwar - 1 year ago 90
Objective-C Question

Removing Title From Navigational Bar

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

Answer Source


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


or do like this:

UIBarButtonItem *btn = [[UIBarButtonItem alloc]init];


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


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

Assign the dictionary

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


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]]; 
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download