hi i'm Xcode Newb ,In a textfield, when we click on it,
A keyboard appears,but when user press return key
How can i hide it?
hi i'm Xcode Newb ,In a textfield, when we click on it,
A keyboard appears,but when user press return key
How can i hide it?
set delegate of UITextField, and over ride, textFieldShouldReturn method, in that method just write following two lines:
[textField resignFirstResponder]; return YES;
that's it. Before writing a code dont forget to set delegate of a UITextField and set Return key type to "Done" from properties window.(command + shift + I).
First make your file delegate for UITextField and then add this method to your code ..
-(BOOL) textFieldShouldReturn:(UITextField *)textField{
[textField resignFirstResponder];
return YES;
}