How can I use a single UIToolbar with multiple different UIViewControllers?

Posted by Aeonaut on Stack Overflow See other posts from Stack Overflow or by Aeonaut
Published on 2010-08-19T14:47:17Z Indexed on 2010/12/27 17:54 UTC
Read the original article Hit count: 228

I have a simple app with two basic screens, a UIMapView and a UITableView. I'd like to have a toolbar at the bottom with a couple of buttons and a UISegmentedControl with two segments: "Map" and "Table". (The layout is similar to the Google Maps app that ships with the iPhone.) How can I keep the same toolbar while presenting either the UIMapView (with a UIMapViewController) or the UITableView (with a UITableViewController) when the user switches back and forth on the segmented control? Of course, I can just create an identical toolbar for each of the two different views and display them separately, but is there a better way?

© Stack Overflow or respective owner

Related posts about cocoa-touch

Related posts about xcode