我正在尝试设置一个时间间隔为 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/