我正在迭代更新UIProgressView
。值从0.0开始并增加到1.0。
有2个问题:
i == 0.0
时栏的外观:这是我在操场上运行的代码:
import UIKit
let progressView = UIProgressView(frame: CGRect(origin: .zero, size: CGSize(width: 100, height: 100)))
progressView.trackTintColor = .white
progressView.progressTintColor = .black
progressView.layer.cornerRadius = 2.5
progressView.clipsToBounds = true
var i: Float = 0.0
while i <= 1.0 {
i += 0.0001
progressView.progress = i
}
问题是:
为什么将进度条设置为0.0时,进度条不会空白?为什么要等到0.05左右然后“跳”?
为什么更新Flakey? (animated
设置为true
)。