iOS-键盘的弹出与隐藏

#pragma  mark – 点击完成隐藏键盘
-(BOOL)textFieldShouldReturn:(UITextField *)textField
{
[textField resignFirstResponder];
return YES;
}
#pragma mark – 点击空白区域 隐藏键盘
-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
{
[_phoneTextField resignFirstResponder];
[_codeTextField  resignFirstResponder];
}

发表评论

电子邮件地址不会被公开。 必填项已用*标注