首页 > 代码库 > 关闭键盘

关闭键盘

UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapOnce)];//定义一个手势[tap setNumberOfTouchesRequired:1];//触击次数这里设为1[editShopTableView addGestureRecognizer:tap];//添加手势到View中-(void)tapOnce//手势方法{    [textFieldShopName resignFirstResponder];    [textFieldWeChatID resignFirstResponder];}