Search code examples
iosobjective-cios6

Remove gradient on UINavigationController


Is there a way to remove the gradient on the navigationBar on UINavigationController in iOS6.

I have tried making a subclass of UINavigationController then set the navigationBar of it to the subclass though it says that the navigationBar is a readOnly variable


Solution

  • how about -[setBackgroundImage: forBarMetrics] , you can use a single pixel image with the color of your choice.

    but, to set the class of the navBar of your UINavController use -[ initWithNavigationBarClass:toolbarClass:] , or, just set it on the navigationBar object on the storyboard or nib if your using one.