How to enable cancel button with UISearchBar?
问题 In the contacts app on the iPhone if you enter a search term, then tap the "Search" button, the keyboard is hidden, BUT the cancel button is still enabled. In my app the cancel button gets disabled when I call resignFirstResponder. Anyone know how to hide the keyboard while maintaining the cancel button in an enabled state? I use the following code: - (void)searchBarSearchButtonClicked:(UISearchBar *)searchBar { [searchBar resignFirstResponder]; } The keyboard slides out of view, but the