tags:

views:

36

answers:

1

I want to set the keyboard type of the UISearchBar to UIKeyboardAppearanceAlert, but I can't seem to access the UIKeyboard of the UISearchBar.

A: 

You need to access the inner UITextView in the UISearchBar itself.

UITextField *textField = (UITextField *)[[searchBar subviews] objectAtIndex:0];
textField.keyboardAppearance = UIKeyboardAppearanceAlert;
Jacob Relkin
Thank you!The correct property is keyboardAppearance by the way.
Michael Yang