UIProgressView控件
用处:进度条视图,用来显示某个任务的当前状态
-(void)viewDidLoad
{
[self viewDidLoad];
self.timer = [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(change:) userInfo:nil repeats:YES];
self.pv = [[UIProgressView alloc]initWithProgressViewStyle:UIProgressViewStyleDefault];
self.pv.frame = CGMake(20,20,100,20);
//进度颜色
self.pv.progressTintColor = [UIColor redColor];
//底色颜色
self.pv.trackTintColor = [UIColor greenColor];
//当前进度
self.pv.progress = 0.0;
[self.view addSubView:self.pv];
}
-(IBAction) change:(NSTimer*)myTimer
{
self.pv.progress +=0.1;
[self.timer invalidate];
}