I know this has been mentioned many times in this forum, but I have searched and could not get any of them to work.
I need a code to have my keyboard go back down after the user presses the return button or touches somewhere else on the screen. This code needs to be all programmatic as I did not use Interface Builder for this. I hope someone can help.
here is my code in the .m file
Code:
- (void)viewDidLoad {
CGRect frame = CGRectMake(20.0, 68.0, 280.0, 31.0);
UITextField *textField = [[UITextField alloc] initWithFrame:frame];
self.string = textField.text;
textField.textAlignment = UITextAlignmentLeft;
textField.borderStyle = UITextBorderStyleBezel;
textField.autocapitalizationType = UITextAutocapitalizationTypeSentences;
textField.keyboardType = UIKeyboardTypeAlphabet;
textField.returnKeyType = UIReturnKeyDefault;
textField.textColor = [UIColor redColor];
[textField resignFirstResponder];
[self.view addSubview:textField];
Thanks in advance