Search code examples
ios8uisplitviewcontroller

How do I change the text color of the button returned by displayModeButtonItem in iOS 8?


In iOS8 I am using a splitViewController to present my data. I have a custom color for the navigation bar (light blue) and I set the color for the title to white. I would like to change the color of the text in the displayModeButtonItem to white as well, but no matter what I do, it stays the default blue when displayed on the iPhone. When displayed on the iPad it is white.

I have tried

    self.navigationItem.leftBarButtonItem = [self.splitViewController displayModeButtonItem];

self.navigationItem.leftBarButtonItem.tintColor = [UIColor whiteColor];

but that does nothing. It seems that since this button is handled automatically by iOS, nothing I do can change it. Is there somewhere that I can intercept this button and set its color?


Solution

  • This is tricky to find. In Interface Builder, you need to:

    1. Find the Navigation controller for the Master View Controller.
    2. Select the Navigation Bar
    3. Change the Tint

    Visual Guide to changing return button tint