美文网首页ios开发整理
UIProgressView进度条的属性介绍

UIProgressView进度条的属性介绍

作者: 我的天空蔚蓝色 | 来源:发表于2015-10-14 17:01 被阅读4369次

    - (void)viewDidLoad {

    [super viewDidLoad];


    UIProgressView*oneProgressView = [[UIProgressView alloc]init];


    oneProgressView.frame=CGRectMake(0,30,320,30);//设置UIProgressView的位置和大小

    self.oneProgressView.transform = CGAffineTransformMakeScale(1.0f, 4.0f);//改变进度条的高度


    oneProgressView.backgroundColor= [UIColor clearColor];//设置背景色


    oneProgressView.progressViewStyle = UIProgressViewStyleDefault;//进度条风格 就两种


    oneProgressView.alpha=1.0;//设置透明度范围在0.0-1.0之间0.0为全透明


    oneProgressView.progressTintColor= [UIColor yellowColor];//设置已过进度部分的颜色

    oneProgressView.trackTintColor= [UIColor blackColor];//设置未过进度部分的颜色


    oneProgressView.progress=0.2;//设置初始值,范围在0.0-1.0之间,默认是0.0


     [oneProgressView setProgress:0.8 animated:YES]; //设置初始值,可以看到动画效果


      oneProgressView.progressImage = [UIImage imageNamed:@"hsp_07"];


    oneProgressView.trackImage = [UIImage imageNamed:@"hsp_08"];.


    [self.view addSubview:pview];//添加到视图上

    }

    相关文章

      网友评论

      本文标题:UIProgressView进度条的属性介绍

      本文链接:https://www.haomeiwen.com/subject/kfwocttx.html