Hab
Hab

Reputation:

Keyboard doesn't disappear

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];

Upvotes: 1

Views: 1888

Answers (1)

jbrennan
jbrennan

Reputation: 12003

You should use the resignFirstResponder method of UIResponder, which UITextField inherits from:

[tempTextField resignFirstResponder];

Upvotes: 7

Related Questions