美文网首页
点击空白失去响应键盘

点击空白失去响应键盘

作者: HuLL乐乐 | 来源:发表于2016-08-27 11:25 被阅读12次

//点击空白键盘失去响应

self.view.userInteractionEnabled = YES;

UITapGestureRecognizer *singleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(fingerTapped:)];

[self.view addGestureRecognizer:singleTap];

#pragma mark 键盘失去响应

-(void)fingerTapped:(UITapGestureRecognizer *)gestureRecognizer

{

self.view.userInteractionEnabled = YES;

[self.view endEditing:YES];

}

相关文章

网友评论

      本文标题:点击空白失去响应键盘

      本文链接:https://www.haomeiwen.com/subject/yazzsttx.html