gpt4 book ai didi

ios - UIDatePicker间隔10分钟?

转载 作者:可可西里 更新时间:2023-11-01 03:37:43 24 4
gpt4 key购买 nike

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

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com