ios中怎么设置textfield点击其他地方键盘收回
2个回答
2016-05-02 · 知道合伙人互联网行家
关注
展开全部
//在点击需要收回键盘的视图添加单击手势
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(reKeyBoard)];
[self.view addGestureRecognizer:tap];
//实现方法//取消textView ,textField的第一响应者即可
- (void)reKeyBoard
{
[_introduceGroupField resignFirstResponder];
[_nameGroupField resignFirstResponder];
}
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(reKeyBoard)];
[self.view addGestureRecognizer:tap];
//实现方法//取消textView ,textField的第一响应者即可
- (void)reKeyBoard
{
[_introduceGroupField resignFirstResponder];
[_nameGroupField resignFirstResponder];
}
2016-05-10 · 知道合伙人互联网行家
关注
展开全部
//在点击需要收回键盘的视图添加单击手势
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(reKeyBoard)];
[self.view addGestureRecognizer:tap];
//实现方法//取消textView ,textField的第一响应者即可
- (void)reKeyBoard
{
[_introduceGroupField resignFirstResponder];
[_nameGroupField resignFirstResponder];
}
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(reKeyBoard)];
[self.view addGestureRecognizer:tap];
//实现方法//取消textView ,textField的第一响应者即可
- (void)reKeyBoard
{
[_introduceGroupField resignFirstResponder];
[_nameGroupField resignFirstResponder];
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询