- (void)viewDidLoad
{
self.datePicker = [[UIDatePicker alloc] init];
self.datePicker.datePickerMode = UIDatePickerModeDate;
[self.datePicker addTarget:self action:@selector(datePickerValueChanged) forControlEvents:UIControlEventValueChanged];
issue.inputView = self.datePicker;
}
What are the suggestions for adding the “Next” button to the top of the toolbar?
I have a UITextField, and I set the inputView to UIDatePicker so that when I press UITextField instead of the keyboard, the UIDatePicker will pop up. I also I want to add a toolbar with a “Next” button on it so that the user can easily jump to the next field, but I don’t know how to do this because I have changed the view on the UITextField to get the UIDatePicker. The following is the code used when loading the view:
- (void)viewDidLoad
{
self.datePicker = [[UIDatePicker alloc] init ];
self.datePicker.datePickerMode = UIDatePickerModeDate;
[self.datePicker addTarget:self action:@selector(datePickerValueChanged) forControlEvents:UIControlEventValueChanged];
issue.inputView = self.datePicker;< br />}
What is the suggestion for adding the “Next” button to the top of the toolbar?
Create a view to use as an inputAccessoryView for a text field. This view should contain your buttons (e.g., next, cancel, previous page). < /p>