问题
I have standard master-detail navigation based app with first VC as UITableView. I want almost standard UITableView with custom tableHeaderView (UISearchBar enhanced with additional button).
First I have tried to set UISearchBar as header view and everything works just fine.
But when I set a custom view (even simple empty UIView) as tableHeaderView, table begins to behave wrongly:
- Header view scroll offset is not adjusted automatically (i.e. header not automatically slides up or down)
- When push to another view controller happens, UITableView scrolls to Zero contentOffset, which is noticeable by user
This is strangle because UISearchBar being set as header should not affect tableView scroll logic. Maybe apple uses some hidden APIs?
Anyway, is there a way to make custom header that works smoothly like with a SeacrBar (without side effects)?
来源:https://stackoverflow.com/questions/22826810/uitableview-with-header-works-incorrectly-for-any-view-except-uisearchbar