在tableView的底部视图中,添加了一个文本输入框
要求:当键盘弹出时,点击屏幕让键盘消失
代码如下:
//给view添加手势
UITapGestureRecognizer *gest = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(viewdeshoushi)];
[self addGestureRecognizer:gest];
- (void)viewdeshoushi{
[self endEditing:YES];
}