UIProgressView

创建UIProgressView

let progressView = UIProgressView(progressViewStyle:.Default)
progressView.frame = CGRectMake(20, 100, 300, 0)
self.view.addSubview(progressView)

设置属性

progressView.transform = CGAffineTransformMakeScale(1, 5)//修改进度条宽高
progressView.progress = 0.1//进度
progressView.progressTintColor = UIColor.greenColor()//已有进度颜色
progressView.trackTintColor = UIColor.lightGrayColor()//剩余进度颜色

两秒后更新进度

self.performSelector(Selector("animationProgress:"), withObject: progressView, afterDelay: 2)
func animationProgress(progressView : UIProgressView){
    progressView.setProgress(1, animated: true)
}

  

来源: http://www.cnblogs.com/spaceID/p/4976939.html   

posted @ 2015-11-19 10:54  寻找小猪  阅读(145)  评论(0编辑  收藏  举报