简体   繁体   English

带有 countDownTimer = 0 的 UIDatePicker 显示“0 小时 1 分钟”

[英]UIDatePicker with countDownTimer = 0 shows "0 hours 1 min"

var interval = enddate.timeIntervalSince(startdate)
interval = 0 // even if I set it explicitly to zero, it still doesn't work
self.datepicker.datePickerMode = .countDownTimer
self.datepicker.countDownDuration = interval

startdate and enddate are the same date, so the interval=0 but just to double check I've set the interval=0 explicitly and it still doesn't work. startdateenddate是相同的日期,所以interval=0但只是为了仔细检查我已经明确设置了 interval=0 并且它仍然不起作用。

The UIDatePicker shows up in countDownTimer mode, but the ui elements are set to "0 hours, 1 min" instead of "0 hours, 0 min". UIDatePicker 以 countDownTimer 模式显示,但 ui 元素设置为“0 小时 1 分钟”而不是“0 小时 0 分钟”。

Why won't the date picker set to 0 mins to start?为什么日期选择器不会设置为 0 分钟开始?

在此处输入图片说明

The Countdown Timer Picker can't be set to 0 hours and 0 minutes.倒数计时器选择器不能设置为 0 小时 0 分钟。 Think about it, will the user ever set a countdown for 0 time interval?想一想,用户会不会设置0时间间隔的倒计时? It starts at 1 so that when the user starts the countdown there's always some amount of time to countdown to.它从 1 开始,这样当用户开始倒计时,总有一些时间可以倒计时。

You can cross-check this in the system Clock app.您可以在系统时钟应用程序中对此进行交叉检查。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM