Question

When using a UITextfield to enter information a keyboard pops up on the iphone simulator, the information with it says it will disappear again when return is pressed but it does not.

is there a line of code I need to add so that it will disappear again or is this a querk with the simulator??.

Carl.

Was it helpful?

Solution

If you set up your text field similar to this:

UITextField *textField = [[UITextField alloc]initWithFrame:CGRectZero];
...
textField.returnKeyType = UIReturnKeyDone;

you can see some of the basic options. I suspect that you might be missing the returnKeyType = UIReturnKeyDone. By default the return key will not behave this way.

Alternatively, if you resignFirstResponder the keyboard will go away, as others suggest. It sounds like you want the Return key in the keyboard to do this though.

OTHER TIPS

Check this Stack Overflow question out. It has everything you need to solve your problem.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top