Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

uitextfield hide keyboard?

On the iphone. When I press on the uitextfield I don't want a keyboard to popup.

I want the same behavior, just no keyboard at all. How can I hide/close the keyboard when the user presses the uitextfield?

like image 535
user648244 Avatar asked Dec 13 '22 14:12

user648244


2 Answers

If you want the exact same behavior, without the keyboard, try

textfield.inputView = [[[UIView alloc] initWithFrame:CGRectZero] autorelease];
like image 115
mvds Avatar answered Dec 28 '22 05:12

mvds


Returning NO to UITextFieldDelegate's - (BOOL)textFieldShouldBeginEditing:(UITextField *)textField should do it.

like image 42
unexpectedvalue Avatar answered Dec 28 '22 05:12

unexpectedvalue