创建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值改变造成进度条往前走   

相关文章:

  • 2022-12-23
  • 2021-12-03
  • 2021-06-10
  • 2021-11-02
  • 2021-10-26
猜你喜欢
  • 2021-12-30
  • 2021-06-01
  • 2022-01-13
  • 2018-03-08
  • 2021-12-03
  • 2022-12-23
  • 2021-11-23
相关资源
相似解决方案