您的位置:首页 > 产品设计 > UI/UE

UIProgressView(进度条)

2016-01-12 22:47 477 查看
//创建一个进度条
    myprogress=[[UIProgressView alloc]initWithFrame:CGRectMake(0, 300, self.view.frame.size.width, 30)];
    //进度条的类型
    myprogress.progressViewStyle=UIProgressViewStyleBar;
    //为进度条添加图片
    myprogress.progressImage=[UIImage imageNamed:@"1.jpg"];
    //为进度条添加纹理色
    myprogress.tintColor=[UIColor grayColor];
    //为进度条添加背景色
    myprogress.backgroundColor=[UIColor clearColor];
    //进度条的初始位置
    myprogress.progress=0.0;
    [self.view addSubview:myprogress];
    //进度条大小的缩放
    myprogress.transform=CGAffineTransformMakeScale(20,1);
    //进度条旋转角度
    myprogress.transform=CGAffineTransformRotate(myprogress.transform,
-M_PI_2);
    //设置圆角半径
    myprogress.layer.cornerRadius=5;
    myprogress.layer.masksToBounds=YES;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: