Return to Snippet

Revision: 39997
at January 24, 2011 21:13 by suibhne


Initial Code
// Set the return key and keyboard appearance of the search bar
        for (UIView *searchBarSubview in [tableSearchBar subviews]) {
            if ([searchBarSubview conformsToProtocol:@protocol(UITextInputTraits)]) {
                @try {
                    [(UITextField *)searchBarSubview setReturnKeyType:UIReturnKeyDone];
                    [(UITextField *)searchBarSubview setKeyboardAppearance:UIKeyboardAppearanceAlert];
                }
                @catch (NSException * e) {

                    // ignore exception
                }
            }
        }

Initial URL

                                

Initial Description
This will set the keyboard appearance of the UISearchBar text field to be black and see through.

Initial Title
Set Keyboard Appearance of UISearchBar

Initial Tags

                                

Initial Language
Objective C