点击空白关闭键盘
2016-12-06 17:26
246 查看
//点击空白收回键盘
-(void)touchReturnPad{
self.view.userInteractionEnabled = YES;
UITapGestureRecognizer *singleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(fingerTapped:)];
[self.view addGestureRecognizer:singleTap];
}
-(void)fingerTapped:(UITapGestureRecognizer *)gestureRecognizer
{
[self.view endEditing:YES
4000
];
}
-(void)touchReturnPad{
self.view.userInteractionEnabled = YES;
UITapGestureRecognizer *singleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(fingerTapped:)];
[self.view addGestureRecognizer:singleTap];
}
-(void)fingerTapped:(UITapGestureRecognizer *)gestureRecognizer
{
[self.view endEditing:YES
4000
];
}
相关文章推荐
- tableview占整个屏幕,数据只有一条的时候,点击空白地方,关闭键盘的方法
- IOS 点击屏幕空白部分关闭键盘方法
- 点击空白关闭键盘
- android 监听软键盘弹起和关闭状态与点击空白区域软键盘隐藏
- IOS(1) 点击空白区域隐藏(关闭)键盘
- 点击空白关闭键盘
- 点击任意空白收回键盘
- 两点技巧-给TextView添加Tag,点击空白收起键盘
- 关于iOS 点击空白处关闭键盘(手势)
- 点击空白出隐藏键盘,或者点击按钮隐藏软键盘
- 关于点击空白关闭弹窗的js写法推荐
- searchbar在点击屏幕上空白区域后收起键盘
- 关于点击空白关闭弹窗的js写法推荐
- editbox点击空白隐藏键盘
- android朋友圈监听键盘状态 点击空白区域隐藏键盘
- iOS开发用最简单粗暴的方法实现点击空白收回键盘
- 为实现真正的点击空白收起键盘,让UITableView响应touch事件
- iOS点击键盘以外空白区域隐藏键盘的常见方法
- 点击屏幕空白处让键盘消失的方法
- 点击屏幕,让UITextField关闭键盘+传值