//这是我的ViewDidLoad代码,用于初始化我的searchBar代码
- (void)viewDidLoad {
[super viewDidLoad];
[self setupInitialView];
[self setInitialView];
self.tblFeedTable.contentOffset = CGPointMake(0, self.searchBarControll.frame.size.height - self.tblFeedTable.contentOffset.y); self.searchBarControll = [[UISearchBar alloc] initWithFrame:CGRectMake(0, 0, 320, 44)]; self.searchBarControll.delegate = self; self.tblFeedTable.tableHeaderView = self.searchBarControll;
}
- (void)searchBarTextDidBeginEditing:(UISearchBar *)searchBar
{
// WHEN CURSON FOCUSE
}
- (void)searchBarCancelButtonClicked:(UISearchBar *) searchBar
{
// WHEN CANCEL BUTTON CLICK
}
-(void)searchBarTextDidEndEditing:(UISearchBar *)searchBar
{
[searchBar setShowsCancelButton:NO animated:YES];
}
是否有任何其他委托方法可以建议我改善搜索体验?
提前致谢。