Taj rajan Taj rajan - 3 months ago 19
iOS Question

back button don't get change color in navigation bar

Sorry for bad english:-(

Here i am using xcode 5 and ios7, Can dnt change color in back button when get after pushviewcontroller.

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
ListViewController *viewList = [[ListViewController alloc] initWithNibName:@“ListViewController” bundle:nil];
[self.navigationController pushViewController: viewList animated:YES];
}


User presses a cell then ListViewController will appear. In Navigation bar, Right bar button appeared pink color. but did not get change color in back bar button. Please see screen shoot i have attached link below.

enter image description here

Can we change color back button in navigation bar?. Or Should add image in back button?

Answer
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
        ListViewController *viewList = [[ListViewController alloc] initWithNibName:@“ListViewController” bundle:nil];
        self.navigationController.navigationBar.tinitColor=[UIColor readcolor]; //set color as you want…..
        [self.navigationController pushViewController: viewList animated:YES];
}

Try it... Happy code :-)