UIProgressView设置进度的动画
Q:UIProgressView进度动画效果会从左上角开始,并由小到大?
- (void)setProgress:(float)progress animated:(BOOL)animated
viewDidLoad里
[self.myProgressView3 setProgress:0.00001 animated:NO];
[self.myProgressView3 setProgress:0.0 animated:YES];
[UIView animateWithDuration:5 animations:^{
[self.myProgressView1 setProgress:0.8 animated:YES];
[self.myProgressView2 setProgress:0.8 animated:YES];
[self.myProgressView3 setProgress:0.8 animated:YES];
} completion:^(BOOL finished) {
}];
区别:第二个progressView设置了backgroundColor为灰色
A:让进度动画一开始高度就充满路径
暂时找到的方法是:
[self.myProgressView3 setProgress:0.00001 animated:NO];
[self.myProgressView3 setProgress:0.0 animated:YES];
end~希望您有所收获
——by roy
网友评论