IOS, tableview filtering select with a search control
I am building a tableview list with a search control to filter it. My requirement is to let user select one cell quickly by input some keywords.
The UI is simple, a navigationbar with an OK button to confirm the selection, a searchbar below the navigationbar, and the tableview in the bottom.
The problem is that, when user try to filter the tableview, the navigationbar would be开发者_Python百科 disappear, the whole screen will go to search mode, the searchbar would in the top of the screen. In that case, when user selected a cell, he/she could not click the OK button I put in the navigation bar to confirm the selection, he/she have to hit the cancel button of the search bar to exist the search mode and then click the OK button I put there. That is not I want to.
How can I deal with this, to make this operation more easier for my user?
Can you try UISearchDisplayController ? It works like an autocomplete box.
http://developer.apple.com/library/ios/#DOCUMENTATION/UIKit/Reference/UISearchDisplayController_Class/Reference/Reference.html
A search display controller manages display of a search bar and a table view that displays the results of a search of data managed by another view controller.
Example: http://developer.apple.com/library/ios/samplecode/TableSearch/Introduction/Intro.html#//apple_ref/doc/uid/DTS40007848
Hope this helps.
精彩评论