ios 自学遇到了很多问题
关于UITextField 点击空白处隐藏键盘,网上确实比较多
但如果想在外层加上UIScrollView的话,则原来的方法都不能隐藏键盘
下面是比较简单的隐藏方法
//隐藏键盘
UITapGestureRecognizer *myTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(scrollTap:)];
[scrollView addGestureRecognizer:myTap];
- (void)scrollTap:(id)sender {
[self.view endEditing:YES];
}