When you create a UINavigationController
, you can reveal its default hidden UIToolbar
via setToolbarHidden:animated:
(or by checking Shows Toolbar in Interface Builder). This causes a toolbar to appear at the bottom of the screen, and this toolbar persists between pushing and popping of view controllers on the navigation stack. That is exactly what I need, except I need the toolbar to be located at the top of the screen. It appears that's exactly what Apple has done with the iTunes app:
How can one move UINavigationController
's toolbar to the top to lie underneath the navigation bar instead of at the bottom?
I've tried to implement the UIToolbarDelegate
, override positionForBar:
, and return UIBarPosition.TopAttached
or UIBarPosition.Top
after setting the delegate
of self.navigationController?.toolbar
to self
, but this did not even call the delegate method therefore it didn't change the bar position.
Note that I need the toolbar to be preserved between navigation, so I can't simply add a toolbar to a view controller and position it under the nav bar.
toolbar.frame.origin.y
value? – koen