Jason Jason - 10 months ago 55
Objective-C Question

RightBarButtonItem disappears when view appears again

My problem is that my RightBarButtonItem, in my navigationItem, disappears after the view appears a second time. The first time the view loads, it displays properly, but the second time it disappears completely.

The button is init'd in viewWillAppear as such:

UIBarButtonItem *optionsButton = [[UIBarButtonItem alloc] initWithCustomView:roundedButton];
self.navigationItem.rightBarButtonItem = optionsButton;

and i remembered to call super

I only touch my navigation controller once more:


Any ideas how this might be happening?

Answer Source

you can use a category to add custom image on navigation bar. Override drawRect method by creating a category on navigation bar. Search on google you will find it. If not let me know. I'll do it for you.