开发者

UISearchDisplayController - how I can disable the automatic search

开发者 https://www.devze.com 2023-03-27 06:24 出处:网络
开发者_JS百科I use a UISearchDisplayController and I search a way to disable the automatic search.

开发者_JS百科I use a UISearchDisplayController and I search a way to disable the automatic search.

Is there a way for that?


Implement the UISearchDisplayControllerDelegate method -searchDisplayController:shouldReloadTableForSearchScope: and return NO. When you want to reload the search table, call [theSearchDisplayController.searchResultsTableView reloadData].


To disable the automatic search in UISearchDisplayController

1) set UISearchDisplayDelegate to self

2) in didShowSearchResultsTableView delegate method

set the frame searchResultsTableView as

CGRect tempFrame= searchDisplayController.searchResultsTableView.frame;
tempFrame.size.height=0.0f;
searchDisplayController.searchResultsTableView.frame=tempFrame;


Here is your answer, which has a nice explanation of how this works. I thought about giving you the answer in a single line but I wanted to let you know more details so you can get a better idea of how it works?

0

精彩评论

暂无评论...
验证码 换一张
取 消