Hi,
I used a UIView with a UITableView in it and dragged a UISearchBar into the header in IB. Worked as expected, the UISearchBar scrolls with the UITableView.
Now I switched to UITableViewController. It provides an UITableView in IB as well, and I dragged a UISearchBar into it's header:
However, the UISearchBar never shows up:
Is there some kind of trick associated with the UISearchBar to make it appear?
Kind Regards
Edit:
Why ever, you need to set it up yourself, even if it's already setup in IB:
Works just fine then:
I used a UIView with a UITableView in it and dragged a UISearchBar into the header in IB. Worked as expected, the UISearchBar scrolls with the UITableView.
Now I switched to UITableViewController. It provides an UITableView in IB as well, and I dragged a UISearchBar into it's header:

However, the UISearchBar never shows up:

Is there some kind of trick associated with the UISearchBar to make it appear?
Kind Regards
Edit:
Why ever, you need to set it up yourself, even if it's already setup in IB:
Code:
- (void)viewDidLoad {
[super viewDidLoad];
searchBar = [[UISearchBar alloc] initWithFrame:CGRectMake(0, 0, self.tableView.frame.size.width, 0)];
searchBar.delegate = self;
[searchBar sizeToFit];
self.tableView.tableHeaderView = searchBar;
[searchBar release];
}
Works just fine then:

Last edited: