tags:

views:

169

answers:

1

How would one implement a search field like the one used on the iPhone Mail application. When you attempt to search it shows up 4 buttons under the search bar with the fields you can search. The search bar actually moves up to cover the navigation bar and exposes those buttons.

I'd like to do something similar in my application where you can specify what exactly you are searching for. I think the mail search is a little difference since it also has a cancel button?

How would you accomplish this and what components would you use?

+2  A: 

Do you mean the so called ScopeBar? Use a SearchDisplayController and there you could set the scopes of the ScopeBar. Or drag a normal UISearchBar on your view, and the with the inspector you are able to set the scope items.

Tim
That was exactly what I was looking for. I hadn't realized there was a control for it, I thought Mail app was doing something special.
jr
+1 Also, check out Apple's TableSearch for example code: http://developer.apple.com/iphone/library/samplecode/TableSearch/index.html#//apple_ref/doc/uid/DTS40007848
gerry3
@gerry3: Thanks! will check it out.
jr