In iOS15 UIProgressView changed behavior. When I use self.progress.setProgress(1.0, animated: true), it starts from transparent style. How to return to "alpha = 1" style.
P.S.: progress.alpha = 1 does not work
In iOS15 UIProgressView changed behavior. When I use self.progress.setProgress(1.0, animated: true), it starts from transparent style. How to return to "alpha = 1" style.
P.S.: progress.alpha = 1 does not work
On
Setting a tintImage with a UIImage extension with color works. This seemed to be the easiest way for me to remove that transparency.
progressView.progressImage = UIImage(color: progressTintColor)
UIImage extension
extension UIImage {
convenience init?(color: UIColor, size: CGSize = CGSize(width: 1, height: 1)) {
let rect = CGRect(origin: .zero, size: size)
UIGraphicsBeginImageContextWithOptions(rect.size, false, 0.0)
color.setFill()
UIRectFill(rect)
let image = UIGraphicsGetImageFromCurrentImageContext()
UIGraphicsEndImageContext()
guard let cgImage = image?.cgImage else { return nil }
self.init(cgImage: cgImage)
} }
The only way to change this opaque/transparent behavior is to use your own Timer.