开发者

How to hide/disable UISearchBars Scopebar

开发者 https://www.devze.com 2023-03-07 17:24 出处:网络
I am using a sample code from apple developer site as a base : http://developer.apple.com/library/ios/#samplecode/TableSearch/Introduction/Intro.html#//apple_ref/doc/uid/DTS40007848-Intro-DontLinkElem

I am using a sample code from apple developer site as a base : http://developer.apple.com/library/ios/#samplecode/TableSearch/Introduction/Intro.html#//apple_ref/doc/uid/DTS40007848-Intro-DontLinkElementID_2 Its a simple table Search code. What I am trying to do is populate a table with my own data with different cell styles and searching the contents using the search bar. Now I wa开发者_StackOverflow社区s successfully able to complete all what I wanted to accomplish here but I want to hide the scopebar which appears when user clicks on search bar. I tried setting scopeButtonTitles = nil using method found here: http://developer.apple.com/library/ios/#documentation/uikit/reference/UISearchBar_Class/Reference/Reference.html

But still the scope bar shows up. If you run the table search bar you can see the scopebar with titles as 'All,device,desktop,portable', I tried searching for an array containig these values but never found one. So can anyone please tell me how to hide the scope bar. What methods should I implement and where should I implement?


Use the showsScopeBar property. Set it to NO.

EDIT

For UISearchBars handled by UISearchDisplayController, you will have to the make that array nil.

self.searchDisplayController.searchBar.scopeButtonTitles = nil;
0

精彩评论

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