ios - UIDatePicker间隔10分钟?

标签 ios objective-c

我正在尝试设置一个时间间隔为 10 分钟的选择器,因此: 8:00,8:10,8:20 等,具有分钟间隔属性:

UIDatePicker *timePick = [[UIDatePicker alloc]initWithFrame:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height/1.5)];
timePick.datePickerMode =UIDatePickerModeTime;

[timePick addTarget:self action:@selector(dateIsChanged:) forControlEvents:UIControlEventValueChanged];
timePick.minuteInterval=10;

发生的事情是时代是这样的:

13:00
14:10
15:20
16:30

现在,如果尝试设置小时间隔,则无法为此找到属性。

有什么问题吗?

最佳答案

我猜你指的是 minuteInterval property可从 iOS2 及更高版本获得。请参阅下面的 Apple 文档。

The interval at which the date picker should display minutes. You can use this property to set the interval displayed by the minutes >wheel (for example, 15 minutes). The interval value must be evenly divided >into 60; if it is not, the default value is used. The default and minimum values are 1; the maximum value is 30.

关于ios - UIDatePicker间隔10分钟?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32839036/

相关文章:

ios - 通过委托(delegate)关闭其呈现的模态视图 Controller 后刷新 UIViewController 中的数据

ios - 与 HealthKit 相关的 info.plist key 令人困惑的问题 - Apple

objective-c - "Couldn’ t 在 10.10 上与辅助应用程序通信

iphone - 我在哪里可以找到关于 iPhone/Objective-C 多线程的好教程?

iphone - Facebook API 在 iOS 上显示法语授权页面

ios - 我如何在 IOS 中读取多个数组中的第一项

ios - MVVM 协调器和弹出 UIViewController

ios - Crashlytics 为混淆的应用程序手动上传 dSYM

ios - 散点图 y 轴不应延伸到 x 轴或 yMin 值以下

ios - 如何从 Storyboard或 xib 加载 iCarousel View ?