Reputation: 1712
I have an application with 6 tabs, so the system automatically generates the first 4 tabs and a fifth tab called "Altro" ("More" in italian) that contains the previous fifth and sixth tab content.
This is ok. The problem is that i don't know how to change the color of the back button when going through the "altro" tab. Any advice?
Some screenshot for a better explanation of the problem:
Upvotes: 0
Views: 158
Reputation: 452
UIImage *buttonImage = [UIImage imageNamed:@"back_btn.png"];
UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
[button setImage:buttonImage forState:UIControlStateNormal];
button.frame = CGRectMake(0, 0, buttonImage.size.width/2, buttonImage.size.height/2);
[button addTarget:self action:@selector(backPressed) forControlEvents:UIControlEventTouchUpInside];
UIBarButtonItem *customBarItem = [[UIBarButtonItem alloc] initWithCustomView:button];
self.navigationItem.leftBarButtonItem = customBarItem;
Try this.......once
Upvotes: 1
Reputation: 3815
You can change the color of backButton using the following code:
self.navigationItem.backBarButtonItem.tintColor = [UIColor redColor];
Upvotes: 0