Thursday, 22 August 2013

Dismiss iPad Keyboard

Dismiss iPad Keyboard

I am creating an iOS application for iPhone and iPad and some of my
screens have UITextFields. I want the keyboard to be dismissed when the
user clicks off of the text box. To do this I have wrote the following
code:
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
[firstName resignFirstResponder];
[lastName resignFirstResponder];
[email resignFirstResponder];
[password resignFirstResponder];
[retypePassword resignFirstResponder];
}
This works fine for the iPhone, but it doesn't work for the keyboard on
iPad. I have searched on the net and all the sugeestions do not work. The
main suggestion is:
- (BOOL)disablesAutomaticKeyboardDismissal {
return NO;
}
But this still does not work? Any help would appreciated.

No comments:

Post a Comment