Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

beachdog

macrumors member
Original poster
Aug 10, 2008
86
0
I have a UISearchBar control in my navbar and it is working fine, except that when the user clicks 'Search' I would like the keyboard to retract so that it uncovers the bottom half of my table view. For some reason -- not sure if its designed that way or I'm doing something wrong -- when the user clicks 'Search' the keyboard stays up. Everything else is working fine -- I get the delegate message and perform the search etc. Is there a way I can programmatically tell the keyboard to retract and disappear?
 

jchildress

macrumors member
Jul 9, 2008
49
0
Take a look at Apple's "TableSearch" example code. In the "MainViewController.m" file there is the following line "[searchBar resignFirstResponder];". I've never used this method like this before but this may be what you need.

I've used the FirstResponder in the opposite manner to have a textField automatically turn on its keyboard when a view appears.
 

springframework

macrumors member
Mar 31, 2008
59
0
the apple uisearchbar tutorial didn't work for me either.

i searched on google 'uisearchbar' and found a blog and it. worked like a charm!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.