I want to put my custom header view to UITableView with automatic scroll offset adjustments which UISearchBar have.
How I can do this?
I want to put my custom header view to UITableView with automatic scroll offset adjustments which UISearchBar have.
How I can do this?
Found workaround. I add my header to UISerachBar as subview and hide all other subviews of search bar
-(void)addHeaderView:(UIView *)view
{
UISearchBar *searchBar = [[UISearchBar alloc] initWithFrame:view.frame];
[searchBar layoutSubviews];
UIView *searchBarView = searchBar.subviews[0];
for (UIView *subview in searchBarView.subviews)
subview.hidden = YES;
view.autoresizingMask = UIViewAutoresizingFlexibleWidth;
[searchBarView addSubview:view];
self.tableHeaderView = searchBar;
}