scrollView 本身继承 了 touch 的响应 事件,要从新自定义 scrollView 的 响应事件。
所以添加一个手势事件:
-(void)addGestureRecognizer
{
UITapGestureRecognizer * sigleTap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(handleTapGesture)];
sigleTap.numberOfTapsRequired = 1;
[myScrollView addGestureRecognizer:sigleTap];
}
-(void)handleTapGesture
{
[myTextField resignFirstResponder];
}
点击scrollview释放键盘触发touchesBegan方法,布布扣,bubuko.com
点击scrollview释放键盘触发touchesBegan方法
原文:http://blog.csdn.net/a1054949000/article/details/19963393