Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change text color of default back button in storyboard

Tags:

ios

iphone

How to change text color of default back button in storyboard.(Both through storyboard and programmatically)? The default color which appears is blue. This question helps in setting text for back button but not the color.

Navigation Bar Image

like image 509
Nitish Avatar asked Dec 26 '14 21:12

Nitish


4 Answers

The color of the back button will be set from storyboard global tint color.

enter image description here

like image 58
Krešimir Prcela Avatar answered Oct 23 '22 22:10

Krešimir Prcela


Nitish,

In your storyboard sidebar make sure you select the Navigation Bar tab of your Navigation Controller - not your table view. Then change the background color of your navigation bar to whatever you have set. Some blue color. As far as I know you can't change the color of your back button within storyboard so after you set the Navigation bar controller color in storyboard like the picture:

Storyboard Then you can accomplish this by putting the following code in your viewDidLoad method:

self.navigationController.navigationBar.tintColor = [UIColor whiteColor]; //your color of what you want, I assume you want white based on your background color

And the outcome will be like so:

Final Outcome

like image 21
soulshined Avatar answered Oct 23 '22 20:10

soulshined


through StoryBoard you can easily set the tint colour.

Select the Navigation Bar tab of your Navigation Controller and then in attributes inspector you can select the tint colour.

like image 36
Sujith Chandran Avatar answered Oct 23 '22 21:10

Sujith Chandran


Using Storyboards - no code changes - I had somehow reset my BACK button to yellow (and boy has that been irritating!) I clicked on the 'Tab Bar Controller' within the 'Tab Bar Controller Scene' and then changed the 'Global Tint' in the 'File Inspector' Hooray! You can actually read the BACK button now.

Changing BACK button Color

like image 27
LaurelS Avatar answered Oct 23 '22 21:10

LaurelS