在ScrollView上的TextFiled隐藏键盘

UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(touchesBegan)];
[self.view addGestureRecognizer:tap];

-(void)touchesBegan{
  [self.view endEditing:YES];
}

给scrollView上添加手势

你可能感兴趣的:(在ScrollView上的TextFiled隐藏键盘)