iOS 收起键盘

//方法1;

[[[UIApplication sharedApplication] keyWindow] endEditing:YES];

//方法2;
[self.view endEditing:YES];

//方法3;
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
[telTextField resignFirstResponder];
}

//方法4;
[self.myTF resignFirstResponder];

你可能感兴趣的:(iOS 收起键盘)