In a detail view of my app, the navigation controller's back button seems to be taking cues for its color from some ungodly manifestation. Via one path to the detail view, it's blue; via another, it's black. In either case, the back button doesn't seem to exist within the self.navigationController object.
So here's a detail view:

And here's a snapshot of the navigation controller at this point:

I'm pretty sure I know how to change the color of this particular element, but I don't know where to find it. Ideas?
VenueTableViewController.m
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
NSDictionary *show;
if( [self.listType isEqualToString:@"showsByRegion"] )
{
NSString *venueIndex = [[self.allShows allKeys] objectAtIndex:[indexPath indexAtPosition:0]];
int index = [indexPath indexAtPosition:1];
show = [[self.allShows objectForKey:venueIndex] objectAtIndex:index];
} else {
int index = [indexPath indexAtPosition:(indexPath.length - 1)];
show = [self.showsAtVenue objectAtIndex:index];
}
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard_iPhone"
bundle:[NSBundle mainBundle]];
detailViewController = [storyboard instantiateViewControllerWithIdentifier:@"InfoViewController"];
detailViewController.showInfo = show;
// Pass the selected object to the new view controller.
[self.navigationController pushViewController:detailViewController animated:YES];
}
InfoViewController.m
- (void)viewDidLoad
{
[super viewDidLoad];
self.tableView = [[self.view subviews] objectAtIndex:1];
[self createInfoViewDictionary];
[self addTopImage];
[self setFrameForTableView];
[self bindLabelsToProperties];
[self.navigationController.navigationBar setTitleTextAttributes:[SHColors sharedInstance].navBarText];
}
If you are getting different colors is because you are getting there from different viewcontrollers and those viewcontrollers have different tintColor.
Then, you need to set the color you want using:
- (void)viewDidLoad
{
....
self.navigationController.navigationBar.tintColor = [UIColor whiteColor];
....
}
If you are thinking in have the same color for all the navigation bar, you can use UIAppearance proxy to set them in AppDelegate (editted: as Jordan Montel said)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With