iphone - iOS UISearchBar:Set showsScopeBar=YES & scopeButtonTitles is not nil , but scopeBar no show -


i going crazy!here issue.i want show uisearchbar.scopebar when begin search , hide after searched.i found solution post in iphone : hide scopebar searchbar not work me. here codes:

   self.friendsearchbar.scopebuttontitles = [nsarray arraywithobjects:@"phone",@"name", nil];    self.friendsearchbar.selectedscopebuttonindex = 0;    self.friendsearchbar.showsscopebar = yes; 

hello have search bar disappear after search need implement this.

- (bool)searchdisplaycontroller:(uisearchdisplaycontroller *)controller shouldreloadtableforsearchstring:(nsstring *)searchstring { yourscopegoeshere scopekey = controller.searchbar.selectedscopebuttonindex; [self searchfortext:searchstring scope:scopekey]; return yes; }  - (bool)searchdisplaycontroller:(uisearchdisplaycontroller *)controller shouldreloadtableforsearchscope:(nsinteger)searchoption { nsstring *searchstring = controller.searchbar.text; [self searchfortext:searchstring scope:searchoption]; return yes; } 

Comments

Popular posts from this blog

android - Inheriting from Theme.AppCompat* -

broadcastreceiver - android BOOT_COMPLETED not received if not activity intent-filter -

basic authentication with http post params android -