在 iOS6 中,我使用下面的代码来改变 UISearchbar 的 inputView
for (UIView *view in _searchBar.subviews) {
if ([view isKindOfClass: [UITextField class]]) {
UITextField* textField = (UITextField*)view;
[textField setInputView:_myKeyboard];
break;
}
}
iOS7 中的 UISearchbar 发生了变化,不知道如何找到 textField 来更改 inputView。请帮忙!谢谢!