UISearchBar disable return key
I have a search bar that when the search button is hit it will call a web service. The results of the web service can be quite large.
What I want to do is disable the "Search" button until the length of the search phrase is at least 3 cha开发者_如何学Pythonracters. This will help in narrowing down the search results.
And yes, I've looked at this post. I can't get it to work for me (3.1.3 SDK).
Is this possible? How would I do this?
You could always add a condition to your searchBarSearchButtonClicked method to check the length of the text in the searchBar. Though that will still show the Search button as enabled, just won't actually do anything even if it's clicked.
精彩评论