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
2009-06-17 02:47:29
A:
Two articles that do exactly this:
http://www.iphonesdkarticles.com/2009/01/uitableview-searching-table-view.html
http://ved-dimensions.blogspot.com/2009/02/iphone-development-adding-search-bar-in.html
Corey Floyd
2009-06-17 19:01:02
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
2009-11-16 20:07:45