I have a uitextfield where is written a date.. how can I show on the bottom of the page a uidatepicker instead of a standard keyboard? thanks in advance
Make sure your class implements the UITextFieldDelegate
protocol. Then, override the shouldBeginEditing
delegate method to return FALSE:
- (BOOL)textFieldShouldBeginEditing:(UITextField *)textField
{
//check if it is the UITextField you don't want the keyboard for
if (textField != dateTextField)
return TRUE;
//present your UIDatePicker
//see instructions below
//Return false to prevent the keyboard from appearing.
return FALSE;
}
I recommend using another UIViewController
that contains a UIDatePicker
and use presentModalViewController
to show it. This conforms to the User-Interface Guidelines.