iOS 键盘

2016-08-01  本文已影响0人  渴_望

直接关闭:

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

[self.view endEditing:YES];


text.returnKeyType =UIReturnKeyDone;//完成

text.delegate =self;

-(BOOL)textFieldShouldReturn:(UITextField *)textField

{

UITextField * name =(UITextField *)[self.view viewWithTag:1222];

[name resignFirstResponder];

return YES;

}

//点击屏幕空白处去掉键盘

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event

{

UITextField * name =(UITextField *)[self.view viewWithTag:1222];

[name resignFirstResponder];

}

上一篇 下一篇

猜你喜欢

热点阅读