How to retrict date on UIDatePickerView?

前端 未结 1 1435
滥情空心
滥情空心 2021-01-14 18:59

hi guys can any body help me to figure out that how i can restrict the minimum date in UIDatePickerView? i tried to set property minumumDate from <

1条回答
  •  执笔经年
    2021-01-14 19:48

    I think you would want to set the mode to 'UIDatePickerDate', as 'UIDatePickerCountDownTimer' is meant to display a time. Have you tried:

    [datePicker setDatePickerMode:UIDatePickerModeDate];
    [datePicker setMinimumDate:minDate];
    

    minDate would be an NSDate with the restricted date. For info on how to initialize this date, see here in the Apple documentation. Especially the part about date components.

    0 讨论(0)
提交回复
热议问题