alxrguz / ALProgressView

Animated and fully customizable progress view with 2 styles: ring and bar.
MIT License
137 stars 18 forks source link

iPad version not working fine #6

Closed fparkarenet closed 5 months ago

fparkarenet commented 5 months ago

On iPad, the circle is getting cutted. Find below screenshot.

Screenshot 2024-05-22 at 10 34 11

Upon further check I found that grooveColor is coming fine however startColor is not working fine. Below is the bigger photo, however you can see in above photo too.

Screenshot 2024-05-23 at 14 39 25

Attaching with green background to see view proper...

Screenshot 2024-05-23 at 14 40 00

Code I used is as below.

let progressRing = ALProgressRing()
graphView.addSubview(progressRing)

progressRing.translatesAutoresizingMaskIntoConstraints = false
progressRing.fillContainer(padding: 14.5*iPhoneFactorX)
progressRing.setProgress(0.8, animated: true)
progressRing.startColor = AppColors.appSecondaryColor
progressRing.grooveColor = AppColors.lightOrangeColor_FBECE8
progressRing.duration = 3
progressRing.lineWidth = 8*iPhoneFactorX
progressRing.backgroundColor = .green
fparkarenet commented 5 months ago

And it works!!! Issue was order of code...

I take progressRing.setProgress(0.8, animated: true) as last line and it worked...

    progressRing.translatesAutoresizingMaskIntoConstraints = false
    progressRing.fillContainer(padding: 14.5*iPhoneFactorX)
    progressRing.startColor = AppColors.appSecondaryColor
    progressRing.endColor = AppColors.appSecondaryColor
    progressRing.grooveColor = AppColors.lightOrangeColor_FBECE8
    progressRing.duration = 3
    progressRing.lineWidth = 8*iPhoneFactorX
    progressRing.setProgress(0.8, animated: true)