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.
我想从我的 UIDatePicker 中隐藏过去和未来的日期。只想显示今天的日期。可能吗?现在所有的日期都快到了,但只有今天的日期在选择。时间也在那里。所以简而言之,我想通过仅显示今天的日期来选择今天的日期时间。
比不需要添加 DatePicker。
NSDateFormatter *formatter; NSString *dateString; formatter = [[NSDateFormatter alloc] init]; [formatter setDateFormat:@"dd-MM-yyyy"]; dateString = [formatter stringFromDate:[NSDate date]];