键盘不消失 [英] Keyboard doesn't disappear
本文介绍了键盘不消失的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在目标c中使用UITextField时,出现键盘,键入一些图形后,我想移动到另一个Textfield或按钮,但是光标不会从文本字段移开,键盘也不会消失.我该怎么办?
While using UITextField in objective c, keyboard appears, after typing some figure I wanna move to another Textfield or button but neither the cursor removes from text field nor the key board disappears. Wat should i do?
tempTextField.borderStyle = UITextBorderStyleBezel;
tempTextField.textColor = [UIColor blackColor];
tempTextField.font = [UIFont systemFontOfSize:17.0];
tempTextField.placeholder = @"";
tempTextField.backgroundColor = [UIColor blueColor];
tempTextField.autocorrectionType = UITextAutocorrectionTypeNo;
tempTextField.keyboardType = UIKeyboardTypeDefault;
tempTextField.returnKeyType = UIReturnKeyDone;
tempTextField.clearButtonMode = UITextFieldViewModeNever;
tempTextField.clearButtonMode = UITextFieldViewModeNever;
[ tempTextField setEnabled: YES ];
self.txtAirportName = tempTextField;
txtAirportName.delegate = self;
[tempTextField release];
推荐答案
您应该使用UIResponder的rel =" nofollow noreferrer> resignFirstResponder
方法,其中
You should use the resignFirstResponder
method of UIResponder
, which UITextField
inherits from:
[tempTextField resignFirstResponder];
这篇关于键盘不消失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文