views:

535

answers:

2

Is it possible to have a UIToolbar on the top of the screen? The example application would be like "Calendar" where it has the "+" on the right, and then the "Calendars" button on the left.

+1  A: 

You can put a UIToolbar anywhere. It's just a UI view.

KennyTM
Thanks. Just all the docs say "At the bottom" of the screen. I got it to work.
jr
A: 

At the top of the screen you would typically put a UINavigationBar. UIToolbars are usually placed at the bottom of the screen.

You can add this either programatically in the loadView method of a UIViewController or graphically in the XIB resource file.

Stephen Darlington
In addition you can add buttons (or any views) to the right and left slots of the navbar. But Apple's Human Interface Guidelines say the navbars go on top and toolbars go on the bottom. Going against that may cause a rejection
Squeegy
Right, but in the Calendar application it really isn't a NavBar on top is it? It's just a toolbar which has a "Calendar" button and a "+" add event button. This is what I am trying to replicate. See my other question about recreating the Calendar view.
jr
@jr In the Calendar app is _is_ a `UINavigationBar` at the top of the screen. Note that on the right of the screen is a "+" button and on the left is a "Back" button which takes you back to the list of available calendars. As Squeegy notes, using the wrong type of interface may cause Apple to reject your app.
Stephen Darlington
@Stephen does that mean that The calendar is based on a UINavigationController?
jr
@jr Yes, Calendar uses `UINavigationController`.
Stephen Darlington