矩形的UISearchBar
for (UIView *searchBarSubview in [self.searchBar subviews]) { if ([searchBarSubview conformsToProtocol:@protocol(UITextInputTraits)]) { @try { [(UITextField *)searchBarSubview setBorderStyle:UITextBorderStyleRoundedRect]; } @catch (NSException * e) { // ignore exception } } }