Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hide UISearchDisplayController of UITableView initially ( iOS SDK )? [duplicate]

How can I hide UISearchDisplayController of UITableView initially ? I just want user to scroll up to see the UISearchBar.

UPDATE: I am thinking of scrolling the UITableView 40px lower, so that the UISearchBar can be "hidden" from user.

like image 723
Raptor Avatar asked Feb 23 '23 18:02

Raptor


1 Answers

My solution is in viewWillAppear:animted :

[my_table_view setContentOffset:CGPointMake(0, searchController.searchBar.bounds.size.height)]; 

UPDATE we should obtain the height of UISearchBar instead of using fixed values.

like image 111
Raptor Avatar answered May 01 '23 11:05

Raptor