Thursday, February 4, 2010

Change keyboard appearance of UISearchBar

It's not built-in the API, so this piece of code will do. It makes your search bar display in black, and with transparency... enjoy! :)

for(UIView *subView in searchBar.subviews)
 if([subView isKindOfClass: [UITextField class]])
  [(UITextField *)subView setKeyboardAppearance: UIKeyboardAppearanceAlert];

4 comments:

Anonymous said...

where should i type it?? in mobileterminal??

Damien Le Berrigaud said...

This is when developing an application.

Anonymous said...

sorry for an other stupid question, is there a way to use the alert keyboard in the default messages applications?

Damien Le Berrigaud said...

Nope there isn't. Unless you jailbreak your phone maybe... but even then I don't think they changed the default applications. :)

Post a Comment