views:

495

answers:

2

How do I add a static search bar (one that doesn't scroll with the UITableView) below the UINavigationController in the root view of a UISplitViewController. The iPad mail app has an example of one of these. Actually I would Ike to add a toolbar with a segmented control instead of a search bar, but I imagine the process is the same.

A: 

Umm... can you re-word this? Do you mean in the left pane of the UISplitViewController? There is no UINavigationController allowed as the parent of a UISplitViewController -- it gives a runtime error in SDK 3.2.

If what you are saying is essentially "How do I add a search bar in the left pane of a UISplitViewController? Then the answer is the same way you would for any view you display as the left pane. Since both panes take simple UIViewControllers (not just a UITableView), you build a nib in IB with the view, the search bar, below that you then put a UITableView. This is the NIB you assign in the so called "Master interface" (left side).

Most people that have this kind of question think that you can only use a UITableView in the "Master Interface" (since that is what it looks like is happening).

Jann
Yes I meant the left pane of a UISplitViewController, so I guess my question is really how should I add a static toolbar below the navigation bar when using UITableViewController? Can I still use that class? Thanks for the help...I'm brand new to iphoneos.
A: 

Yes I meant the left pane of a UISplitViewController, so I guess my question is really how should I add a static toolbar below the navigation bar when using UITableViewController?

You can add any view (except the new iPad split view) to a navigation controller, not only a UITableView. And the added view may have subviews...

Add a plain UIView to the NavigationController. In this UIView, add your searchbar first and then your navigation controller below the search bar. You can even add a toolbar at the bottom.

NavigationController
  UIView
    searchbar
    tableview
    toolbar
MarcS