UIProgressVIew是一个进度条。有两种样式,一种是UIProgressViewStyleBar一种是UIProgressViewStyleDefault,两者无大的区别。
UIProgressView *pro= [[UIProgressView alloc]initWithFrame:CGRectMake(10, 300, self.view.frame.size.width-20, 100)];
pro.trackTintColor=[UIColor blackColor]; //设置进度条背景颜色
pro.progress=0.7; //设置进度默认值,这个相当于百分比,范围在0~1之间,不可以设置最大最小值
pro.progressTintColor=[UIColor redColor]; //设置进度条的颜色
//设置进度条的背景图片trackImage与progressImage属性可以设置进度条 背景和轨迹为图片
[pro setProgress:0.7 animated:YES]; //设置进度值并动画显示