- (void)setReturnKeyType{
//ios7 不用這個有問題
for (UIView *searchBarSubview in [self.searchBarWords subviews]) {
for (UIView *subView in [searchBarSubview subviews]) {
if ([subView conformsToProtocol:@protocol(UITextInputTraits)]) {
@try {
[(UITextField *)subView setReturnKeyType:UIReturnKeyDone];
//[(UITextField *)searchBarSubview setKeyboardAppearance:UIKeyboardAppearanceAlert];
}
@catch (NSException * e) {
// ignore exception
}
}
}
}
}