objective C控制点击背景时关闭键盘的代码
如下内容是关于objective C控制点击背景时关闭键盘的内容。
- (void)viewDidLoad
{
[super viewDidLoad];
initWithTarget:self action:@selector(handleBackgroundTap:)];
tapRecognizer.cancelsTouchesInView = NO;
[self.view addGestureRecognizer:tapRecognizer];
}
{
[nameField resignFirstResponder];
[SexField resignFirstResponder];
}