创建ProgressView
UIProgressView * progressView = [[UIProgressView alloc]initWithFrame:CGRectMake(50, 100, 200, 10)]; progressView.progressViewStyle = UIProgressViewStyleDefault; /* typedef NS_ENUM(NSInteger, UIProgressViewStyle) { UIProgressViewStyleDefault, // normal progress bar UIProgressViewStyleBar __TVOS_PROHIBITED, // for use in a toolbar }; */ progressView.progress = 0; //走过的颜色 progressView.progressTintColor = [UIColor redColor]; //本身的颜色 progressView.trackTintColor = [UIColor greenColor]; [self.view addSubview:progressView];
使用中 progress值改变造成进度条往前走