Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否可以修改NSDatePicker对象以允许0月和/或日列中的值?处理特定日期并不重要但很高兴拥有数据(以及用户可能一开始不知道的数据)的情况。
NSDatePicker
0
在我看来,您的 UI 不会让用户输入特定日期,而是匹配多个日期的模式。您应该为此使用带有复选框的多个字段;就像是:
☑ Year: [ 2009] ☑ Month: [12] ☐ Day: [ ] (field disabled)
如果存在的单位应该始终是一个连续的系列(例如,2009-12 但绝不是 -12-03 或 2009-*-03),请取消选中年份复选框并禁用每个复选框(如果之前的复选框未选中(使用月份始终启用)。