标签: iphone objective-c algorithm math progress-bar
如何正确更新进度条?
我有几秒钟的循环...从60到0(x--)我需要正确更新进度条 考虑到条形值从0.0到1.0 ???
NSLog(@"PROGRESS: %2.2f", ABS(log(100/x)) ); [countDownBar setProgress:ABS(log(100/x)) ];
感谢。
答案 0 :(得分:7)
进度条计数:
(60.0 - x) / 60.0
进度条倒计时:
x / 60.0