- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView {
[[UIApplication sharedApplication] sendAction:@selector(resignFirstResponder) to:nil from:nil forEvent:nil];
}
- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView {
[[UIApplication sharedApplication] sendAction:@selector(resignFirstResponder) to:nil from:nil forEvent:nil];
}
我的目的是当用户滑动 UICollectionView时,在以上代理的方法里执行隐藏键盘,但是加上这两个方法后,UICollectionView时滑动到底部的时候是内部的contentinset发生了变化。请观看图片。![上传中...]()
无
ScrollView有个keyboardDismissMode可以设置