开发者

Anyway to limit DatePicker dates?

开发者 https://www.devze.com 2023-02-21 21:20 出处:网络
If I set the Min and Max dates for the DatePicker, the user can still select them but then th开发者_如何学Goe wheels spin back. I just want a user to pick dates between one or two months, and that\'s

If I set the Min and Max dates for the DatePicker, the user can still select them but then th开发者_如何学Goe wheels spin back. I just want a user to pick dates between one or two months, and that's it. I'm debating whether I would be better off just using the Picker and handling the components and data myself OR is there a way to have the DatePicker not show dates that are outside of the Min/Max bounds?


You cannot remove the values outside the minimumDate and maximumDate range, so the only way would be to create a custom UIPickerView

Apple's Human Interface Guidelines does not have any recommendation on this, but personally I think it's better to use the standard date picker with the disabled values, especially because having only one or two values in the month section (which is the widest) leaves too much whitespace.

0

精彩评论

暂无评论...
验证码 换一张
取 消