在IPhone Objective C中禁用UIDatePicker中的过去日期 [英] Disable Past Date in UIDatePicker in IPhone Objective C

查看:125
本文介绍了在IPhone Objective C中禁用UIDatePicker中的过去日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Objective C和IPhone开发的新手。

I am new to Objective C and IPhone development.

我在我的iPhone应用程序中使用UIDatePicker,我的要求是允许用户选择未来的日期仅来自DatePicker。

I am using a UIDatePicker in my IPhone Application and my requirement is to allow the user to choose the future date only from the DatePicker.

为了做到这一点,我想禁用过去的日期&只在DatePicker中的时间,而不是在代码中进行比较验证。

To do this i want to disable past date & time in DatePicker only instead of putting a compare validation in the code.

这是否可行,或者有一个选项可以在DatePicker控件本身中禁用过去的日期。

Is this possible or there is an option to disable the past date in the DatePicker control itself.

推荐答案

你试过这个吗?

[picker setMinimumDate: [NSDate date]];

这篇关于在IPhone Objective C中禁用UIDatePicker中的过去日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆