//点击其他地方,键盘收起
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent
*)event
{
[super touchesEnded:touches withEvent:event];
[self.viewendEditing:YES];
}
//响应键盘return事件
- (BOOL)textFieldShouldReturn:(UITextField *)textField
{
[textField
resignFirstResponder];
returnYES;
}
时间: 2024-10-13 14:14:08