ios - 在 UIDatePicker 中将 Years 设置为最大值

标签 ios github nsdateformatter uidatepicker

我正在为我的应用程序使用自定义 uidatepicker

https://github.com/christopherney/FlatDatePicker

问题是,最小年份是 1900 年(这很好),但最大年份是 2013 年(这不太好)。我怎样才能改变这个,让最大年份是无限的,甚至像 2200 年之类的?

提前致谢!

最佳答案

只需设置日期选择器的 MaximumDate 属性即可:

datePicker.maximumDate = [NSDate distantFuture];

关于ios - 在 UIDatePicker 中将 Years 设置为最大值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18115449/

相关文章:

ios - UIApplication.shared.applicationIconBadgeNumber 滞后

ios - iOS 上的 Codename One 网络问题

github - 如何在 shields.io 徽章中使用 'logo' 选项?

ios - 如何在 iOS 中获取本地化的时间符号?

swift - 如何在 Swift 中从字符串中拆分日期?

ios - 在 if 条件下将 NSArray 变成 NSMutableArray

iphone - 从 5 月 1 日起 - iPhone 5 支持 - 那么应用商店支持的最低 iOS 版本是多少?

GitHub Actions 矩阵而不使用单独的作业?

github - 可以在 Github 中通过电子邮件向拉取请求添加评论吗?

ios - 使用 Swift 2 将字符串转换为 NSDate