iPhone Set Tint Color of Back Bar Button Item

前端 未结 10 789
清歌不尽
清歌不尽 2020-12-08 22:15

I am trying to set the tint color of the back button within a navigation controller, but nothing is working. I have tried

[self.navigationController.backBa         


        
10条回答
  •  Happy的楠姐
    2020-12-08 22:38

    Well you can certainly change the color of just the Back Button or perhaps any Bar Button on the Navigation bar. Here's a small snippet to do it.

    UIBarButtonItem *backButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonItemStylePlain target:self action:nil];
    backButton.tintColor = [UIColor blackColor];
    [self.navigationItem setBackBarButtonItem:backButton];
    [backButton release];
    

    Well this is just one of the ways for doing this. I hope this helps!! I know the answer for it is already accepted, but I thought to give a proper snippet to it. Cheers!!! Happy Coding!!

提交回复
热议问题