为进度视图更改设置动画

时间:2009-01-02 23:11:44

标签: iphone cocoa-touch

是否可以为UIProgressView的更改设置动画,以使显示屏平滑移动到新值?

有点像NSProgressIndicator。

3 个答案:

答案 0 :(得分:57)

如果您对此感兴趣,请填写错误报告,复制/ 5883058:

标题: UIProgressView setProgress:(float)value animated:(BOOL)animated

问题描述: UIProgressView should有一个setProgress:(float)value animated:(BOOL)animated函数,例如UISlider,可以为进度设置动画。

https://bugreport.apple.com

答案 1 :(得分:3)

在iOS 5中添加了UIProgressView方法setProgress:animated:

[progressView setProgress:1.0 animated:YES];

https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIProgressView_Class/index.html

- (void)setProgress:(float)progress animated:(BOOL)animated
  

动画 - 如果更改应设置动画,则为YES,如果更改应立即发生,则为NO。

     

适用于iOS 5.0及更高版本。

答案 2 :(得分:0)

(Swift版本)

UIProgressView方法setProgress:animated:

self.progressView.setProgress(1, animated: true)

https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIProgressView_Class/index.html

open func setProgress(_ progress: Float, animated: Bool)
  

动画 - TRUE 如果更改应设置动画, FALSE 如果更改应立即发生。

相关问题