Added UIBarButtonItem does not appear in the application until its hit area is touched

Using Xcode 5.1, I created a View controller and embedded it through the editor> Embed In> Navigation Controller. Then I proceeded to add the UIBarButtonItem to my toolbar by dragging and dropping it into the Storyboard.

When I launch the application, I cannot see the button. However, if I press the button where the button should be - only then I can see it.

What could be causing this odd behavior?

+3


source to share


1 answer


It seems that tintColor is not being initialized via storyboard. To make the button appear immediately, simply do:

self.navigationItem.rightBarButtonItem.tintColor = self.view.tintColor;

      



in viewDidLoad and the button will be initialized with the correct color. Seems like Xcode bug.

+2


source







All Articles