Change the default back button text color in storyboard

How can I change the default back button text color in a storyboard (both through the storyboard and programmatically)? The default color is blue. This helps set the text for the back button, but not the color.

Navigation bar image

+6


source to share


6 answers


Nitish,

In the sidebar of the bitmap pane, make sure you select the Navigation Pane tab of your navigation controller and not the table view. Then change the background color of your navigation bar to whatever you have set. Some kind of blue. As far as I know, you cannot change the color of your back button in the storyboard, so after you set the color of the navigation bar controller in the storyboard like the image:

Storyboard Then you can accomplish this by placing 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 result will be like this:

Final outcome

+7


source


through StoryBoard you can set the tint color easily.



Select the "Navigation Bar" tab in your navigation controller, and then in the Attributes inspector, you can choose a tint color.

+3


source


Using storyboard - no code changes - I had some sort of reset the BACK button to yellow (and boy it was annoying!) I clicked the Tab Bar Controller button in the Tab Control Bar Scene and then changed the Global Hue in the "File Inspector" Hooray! You can now read the BACK button.

Changing the BACK button Color

+1


source


The back button color will be set from the overall hue of the storyboard .

enter image description here

+1


source


This is my fix:

[[UINavigationBar appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName: [UIColor whiteColor]}];
[[UINavigationBar appearance] setTintColor:[UIColor whiteColor]];  

      

It works for iOS 7+.

0


source


To change the color of the back button for the entire app in the storyboard, select the navigation bar in the navigation controller. Select Show File Inspector in the Utilities panel. At the bottom of the Interface Builder Document section, set a global hue. This will set the back button color and title text of the navigation bar for all view controllers in your application to the color of your choice.

0


source







All Articles