views:

1318

answers:

3

i want to add a search bar under the navigation bar with uitableview. and i want to search from the database? any idea how to do this

+3  A: 

add the searchbar as the headerView for your table.

UISearchBar *temp = [[UISearchBar alloc]initWithFrame:CGRectMake(0, 0, 320, 45)];
temp.barStyle=UIBarStyleBlackTranslucent;
temp.showsCancelButton=YES;
temp.autocorrectionType=UITextAutocorrectionTypeNo;
temp.autocapitalizationType=UITextAutocapitalizationTypeNone;
temp.delegate=self;
self.tableView.tableHeaderView=temp;
[temp release];
zPesk
A: 

I have the same question. This adds the searchbar, but how do you get it to start of hidden underneath the navbar, much like the iPod app (when you pull down it becomes visible)

Lucius