//声明对象
@property (nonatomic,strong) UIProgressView *progressview;
self.progressview = [[UIProgressView alloc] init];
//设置属性
self.progressview.backgroundColor = [UIColor grayColor];
self.progressview.alpha = 0.8;
self.progressview.frame = CGRectMake((self.view.frame.size.width-150)/2.0,self.view.frame.size.height/2.0, 150, 2);
//设置风格
self.progressview.progressViewStyle = UIProgressViewStyleDefault;
//设置当前进度(0~1)float 类型
self.progressview.progress = 0.7;
//显示填充部分颜色
self.progressview.progressTintColor = [UIColor blueColor];
//显示未填充部分的颜色
self.progressview.trackTintColor = [UIColor greenColor];
//设置填充进度条的部分的图像
//[self.progressview setProgressImage:[UIImage imageNamed:@""]];
//未填充的轨道部分的图像
//设置属性
self.progressview.backgroundColor = [UIColor grayColor];
self.progressview.alpha = 0.8;
self.progressview.frame = CGRectMake((self.view.frame.size.width-150)/2.0,self.view.frame.size.height/2.0, 150, 2);
//设置风格
self.progressview.progressViewStyle = UIProgressViewStyleDefault;
//设置当前进度(0~1)float 类型
self.progressview.progress = 0.7;
//显示填充部分颜色
self.progressview.progressTintColor = [UIColor blueColor];
//显示未填充部分的颜色
self.progressview.trackTintColor = [UIColor greenColor];
//设置填充进度条的部分的图像
//[self.progressview setProgressImage:[UIImage imageNamed:@""]];
//未填充的轨道部分的图像
//[self.progressview setTrackImage:[UIImage imageNamed:@""]];
[self.view addSubview:self.progressview];