I am working on making a search bar above the UITableView, like in the iPod App or Mail app. In the iPod App when you start to type in the search bar the navigation controller disappears and the UISearchBar goes to the top. The animation hasn't been too bad to create, but I want to make sure it behaves exactly like the other search bars in Apple's apps. There are two problems I am having so far:
When I hit "search" on the keyboard or scroll on the tableview the keyboard is dismissed by saying: [searchbar resignFirstResponder];
This works, except that the cancel button on the searchbar is disabled. How do I keep the searchbar's cancelbutton from disabling itself after the searchbar has resigned first responder?After the searchbar has lost focus the user should be free to scroll around in the UITableView. Right now the searchbar is added as the tableHeaderView of the UITableView. This means that when the tableview scrolls, the searchbar scrolls right off the screen. Is there a way to make so the searchbar stays at the top of the UITableView and does not scroll? I could not find any property on UITableView that would let the tableHeaderView hover on top.
Any help would be greatly appreciated. Thanks!