UITextFieldDelegate 有一个方法,当用户单击该小图标- (BOOL)textFieldShouldClear:(UITextField *)textField
时会调用该方法。x
我找不到类似的东西UISearchBar
or UISearchBarDelegate
。是否有另一种方法来确定该按钮/图标是否已在内部单击UISearchBar
?
UITextFieldDelegate 有一个方法,当用户单击该小图标- (BOOL)textFieldShouldClear:(UITextField *)textField
时会调用该方法。x
我找不到类似的东西UISearchBar
or UISearchBarDelegate
。是否有另一种方法来确定该按钮/图标是否已在内部单击UISearchBar
?
这个怎么样(并注意讨论语句):
searchBar:textDidChange:
Tells the delegate that the user changed the search text.
- (void)searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText
Parameters
searchBar
The search bar that is being edited.
searchText
The current text in the search text field.
Discussion
This method is also invoked when text is cleared from the search text field.
Availability
Available in iOS 2.0 and later.
Declared In
UISearchBar.h