您的位置:首页 > 移动开发 > Swift

swift - UIProgressView的用法

2016-07-21 17:54 513 查看
1、创建进度条

progressView.frame = CGRect(x:10, y:230, width:self.view.bounds.size.width - 20, height:150)
progressView.progressViewStyle = .default
progressView.center = self.view.cente
progressView.progress = 0.5 //默认进度50%
self.view.addSubview(progressView)


2、设置进度,同时又动画效果

progressView.setProgress(0.8, animated: true)


3、改变进度条的颜色

progressView.progressTintColor = UIColor.red
progressView.trackTintColor = UIColor.green
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: