Hi,
I've googled around for this problem but I find nothing. I'm wondering if I'm the only one...
I have setup a view with 2 TextFields in IB. Delegates of the TextFields are correctly set and the ViewController implements the UITextFieldDelegate protocol.
I would like to dismiss the keyboard with the "Done" key, but the key is grayed out while the TextField is empty. Once I type any character, the Done key is enabled and I can dismiss the keyboard with:
So, what am I missing? Why is the "Done" key disabled when the TextField is empty?
By the way, I looked at the UICatalog sample program and couldn't figure out how they handle the keyboard hiding.
Another question: How do I dismiss a "Phone Pad" or "Number Pad" keyboard? The textFieldShouldReturn is ignored since there is no Return or Done key. I can set a "Save" or "Cancel" button somewhere in the navigation bar but I really don't know what those buttons need to do in order to hide this keyboard.
Thanks in advance,
Arubinst
I've googled around for this problem but I find nothing. I'm wondering if I'm the only one...
I have setup a view with 2 TextFields in IB. Delegates of the TextFields are correctly set and the ViewController implements the UITextFieldDelegate protocol.
I would like to dismiss the keyboard with the "Done" key, but the key is grayed out while the TextField is empty. Once I type any character, the Done key is enabled and I can dismiss the keyboard with:
Code:
- (BOOL)textFieldShouldReturn:(UITextField *)textField {
NSLog(@"textFieldShouldReturn");
[textField resignFirstResponder];
return YES;
}
So, what am I missing? Why is the "Done" key disabled when the TextField is empty?
By the way, I looked at the UICatalog sample program and couldn't figure out how they handle the keyboard hiding.
Another question: How do I dismiss a "Phone Pad" or "Number Pad" keyboard? The textFieldShouldReturn is ignored since there is no Return or Done key. I can set a "Save" or "Cancel" button somewhere in the navigation bar but I really don't know what those buttons need to do in order to hide this keyboard.
Thanks in advance,
Arubinst