关于滑动tableview隐藏键盘的方法
2018-09-04 本文已影响5人
Youthfulless
-(void)scrollViewDidScroll:(UIScrollView *)scrollView{
[[UIApplication sharedApplication]sendAction:@selector(resignFirstResponder) to:nil from:nil forEvent:nil];
}
-(BOOL)resignFirstResponder{
[_searchBar resignFirstResponder];//使你想做的控件失去第一响应,一般情况就是搜索
return YES;
}