Popup UIPicker instead of keyboard
I want a UIPicker to popup instead of the keyboard when I click on a text field. Is this possible, I've been googling for awhile but can't find anything.
Does anyone have any sample code ?
Regards, St开发者_高级运维ephen
I think this is a more official way to do this:
UIDatePicker *datePicker = [[[UIDatePicker alloc] init] autorelease];
datePicker.datePickerMode = UIDatePickerModeDate;
[datePicker addTarget:self action:@selector(datePickerValueChanged:) forControlEvents:UIControlEventValueChanged];
datePicker.tag = indexPath.row;
textField.inputView = datePicker;
Use [self presentModalViewController:picker] to present a modal view controller when user click on the text field. I hoped that you know how to handle text field event
精彩评论