can i make the searchbar static in iphone application
I want that searchbar should also scroll with scrolling mean when i scroll down searchbar should be visible. as there anyw开发者_如何学Goay to do so... thanks. and sorry for my bad english..
If I understand you correctly, this is what you should do:
Open up the interface builder and make the SearchBar the child of the table view if you want it to scroll along with the contents. If you need it to be always visible, drag it out of the tableview.
Well you can also simply do that
SearchBar =[[UISearchBar alloc]initWithFrame:CGRectMake(10, 5, 300, 50)];
SearchBar.tintColor=[UIColor blackColor];
[SearchBar setDelegate:self];
//[self.view addSubview:search];
table=[[UITableView alloc]initWithFrame:CGRectMake(0, 15, 320, 480) style:UITableViewStyleGrouped];
table.delegate=self;
table.dataSource=self;
table.backgroundColor=[UIColor darkGrayColor];
table.tableHeaderView=SearchBar;
[self.view addSubview:table];
精彩评论