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];
}
分享到: 更多
Separator image Posted in IOS.