1、创建进度条
progressView.frame = CGRectMake(50, 80, SCREEN_WIDTH - 100, 30) progressView.progressViewStyle = UIProgressViewStyle.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.redColor() progressView.trackTintColor = UIColor.greenColor()
时间: 2024-11-10 07:25:48