UIProgressView 的简单使用

 UIProgressView *progressView = [[UIProgressView alloc]initWithFrame:CGRectMake(50, 200, 200, 20)];
    //进度条 完成的颜色
    progressView.progressTintColor = [UIColor redColor];
    //进度条 未完成的颜色
    progressView.trackTintColor = [UIColor blueColor];
    
    //利用图片 作为进度条
//    progressView.progressImage = [UIImage imageNamed:@""];
//    progressView.trackImage = [UIImage imageNamed:@"矩形3"];
    
    //进度条 完成值
    progressView.progress = 0.7;
    
    // 动画加载出来
    //[progressView setProgress:0.7 animated:YES];
    
    // 设定宽高  宽一般不改
    CGAffineTransform transform = CGAffineTransformMakeScale(1.0f, 3.0f);
    progressView.transform = transform;
    
    //设定两端弧度
    progressView.layer.cornerRadius = 5.0;
    progressView.layer.masksToBounds = YES;
    
    [self.view addSubview:progressView];

你可能感兴趣的:(UIProgressView 的简单使用)