I am required to create two UISearchBars in my tableView. I want both of them of equal width on top of the table (side-by-side).
I have created two outlets of UISear
You are simply reassigning it when you do self.tableView.tableHeaderView= searchBar;
. You will have to build a view that contains both the search bars and then set it to the table's header view. Something like this,
searchBar = [[UISearchBar alloc] initWithFrame:CGRectMake(0, 0, 200, 45)];
zipSearchBar = [[UISearchBar alloc] initWithFrame:CGRectMake(200, 0, 120, 45)];
searchBar.placeholder = @"School Name";
zipSearchBar.placeholder=@"Zip";
searchBar.delegate = self;
zipSearchBar.delegate = self;
UIView * comboView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 45)];
[comboView addSubview:searchBar];
[comboView addSubview:zipSearchBar];
self.tableView.tableHeaderView= comboView;
[comboView release];