下面是最常用的几个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

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-02-17
  • 2022-03-04
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-20
  • 2021-07-16
  • 2021-10-17
相关资源
相似解决方案