I have a UIViewController. I want to add a UIToolbar to the bottom, but IB is not letting me. How can I achieve this?
Note: The UIViewController is part of a UINavigationController. I'm not sure if this affects the visibility of the toolbar.
I have a UIViewController. I want to add a UIToolbar to the bottom, but IB is not letting me. How can I achieve this?
Note: The UIViewController is part of a UINavigationController. I'm not sure if this affects the visibility of the toolbar.
You can't add toolbar in IB, in IB all you can do is - set a dummy toolbar / navigation bar / tabBar etc. so that you can simulate them to arrange your view's subviews appropriately.
To set the toolbar for that viewController, you have to fill the UIViewController's:
or
so this toolbar and its items will be displayed when your viewController is presented.
Starting from iOS 3.0 you can set toolbar items you want using following
UIViewController
's method:of simply set or override
toolbarItems
property.And toolbar will appear automatically if you put your view controller inside navigation controller.