Add navigation element to view controller

I had a navigation controller based app and decided to use tab bars. And in some views I don't need to assign a navigation controller to the assigned view controller, but I still want to have an "add" button in the top right corner of my view.

What's the easiest way to do this? I tried to add a navigation element to my view, but it is not showing.

-1


source to share


1 answer


What I would do is pretend UINavigationViewController

so you can access navigationItem

it even if you are not pushing the view onto the stack.

I am not sure about just having UINavigationBar

and assigning a button.



Or you can try and work around with help UIToolbar

and see if you can tweak it to your satisfaction.

+1


source







All Articles