UISearchBar的常用代理

下面是最常用的几个SearchBarDelegate:

- (void)searchBarTextDidBeginEditing:(UISearchBar *)searchBar{
        //已经开始编辑
}// called when text starts editing
- (void)searchBarTextDidEndEditing:(UISearchBar *)searchBar{ NSLog(@"收键盘监听"); }// called when text ends editing

- (void)searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText{ //searchText是searchBar上的文字 每次输入或删除都都会打印全部 }// called when text changes (including clear)
//点击键盘上搜索时的相应事件 - (void)searchBarSearchButtonClicked:(UISearchBar *)searchBar{ }// called when keyboard search button pressed

 

posted @ 2017-04-19 18:14  福泽小院  阅读(2689)  评论(0编辑  收藏  举报