iOS – Add UIButton to UIDATEPICKER

I have a UITextField, I set the inputView to UIDatePicker so that when I press UITextField instead of the keyboard, the UIDatePicker will pop up. I also want to add a “Next “Button on the toolbar 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;
}

What are the suggestions for adding the “Next” button to the top of the toolbar?

Create a view to use as inputAccessoryView for text fields. This view should contain your buttons (e.g. , Next step, cancel, previous page).

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>

WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 3900 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC

Leave a Comment

Your email address will not be published.