iPhone UIDatePicker 设置MaximumDate
我正在尝试构建一个日期选择器,其中今天作为最小日期,2011 年 2 月 1 日作为最大日期。
我已按如下方式设置了最小日期
[picker setMinimumDate: [NSDate date]];
,效果很好,但最大日期似乎不正确。
[picker setMaximumDate: [NSDate dateWithNaturalLanguageString:@"11/02/01"]];
如何正确设置最大日期?
I am trying to build a datepicker which has today as a minimum date and 1 Feb 2011 as Maximum date.
I have set the minimum date as followed
[picker setMinimumDate: [NSDate date]];
and this works just fine but the MaximumDate does not seem to be correct.
[picker setMaximumDate: [NSDate dateWithNaturalLanguageString:@"11/02/01"]];
How do I set the maximum date correctly?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
更多
发布评论
评论(3)
找到了答案。不管怎样,谢谢你的帮助。
Found the answer. Thanks anyway for your help.
听到显示日期 当前日期到 minDate 以及五年(向后)到 maxDate
它只展示了五年......
hear showing date current date to minDate and five year(back) to maxDate
it's show only five year.....
您也可以在 Interface Builder 的调色板中执行此操作。我认为如果您按“Command-1”,它将切换到调色板中的一个选项卡,允许您设置选择器的最大日期。
You can also do it in Interface Builder's palette. I think if you press "Command-1" it will switch to a tab in the palette that allows you to set the Maximum date for the picker.