UIProgressView设置高度和简单实用

{atom

    //通常用来表示下载或视频播放的进度orm

    UIProgressView *_progressView;视频

}it

//定义一个进度条属性form

@property(retain,nonatomic) UIProgressView * pView;transform

 

 //进度条的建立下载

    _progressView =[[UIProgressView alloc]init];view

 

    //进度条的位置大小设置vi

    //进度条的高度是不能够变化的,这里的40是不起任何做用的系统默认co

    _progressView.frame=CGRectMake(0, biaotouView.frame.size.height+biaotouView.frame.origin.y, SCREEN_WIDTH, 10);

 _progressView.transform = CGAffineTransformMakeScale(1.0f,4.0f);

    //甚至进度条的风格颜色值,默认是蓝色的

    _progressView.progressTintColor=[UIColor colorWithRed:40/255.0 green:166/255.0 blue:175/255.0 alpha:1];

 

    //表示进度条未完成的,剩余的轨迹颜色,默认是灰色

    _progressView.trackTintColor =[UIColor colorWithRed:206/255.0 green:206/255.0 blue:206/255.0 alpha:1];

 

 

    //设置进度条的进度值

    //范围从0~1,最小值为0,最大值为1.

    //0.8-->进度的80%

    _progressView.progress=0.3;

 

    //设置进度条的风格特征

    //    _progressView.progressViewStyle=UIProgressViewStyleBar;

    _progressView.progressViewStyle=UIProgressViewStyleDefault;

 

    [biaotouView addSubview:_progressView];

相关文章
相关标签/搜索