Reputation: 643
I am a starter with PaintCode and Know how to draw a Progress bar, but How to draw a image like below.Thks for help with a parameter I can control the number and the Progress
Upvotes: 3
Views: 464
Reputation: 180
you can do it using end or start angle parameter of oval and one variable (value: 0.0-1.0) and two expressions: angle = (360-value*360) textValue = stringFromNumber(100*value) +"%". Seet this screenshot. Your drawing method is then: - (void)drawProgressWithValue: (CGFloat)value. It is really easy.
Making progress arc in PaintCode
— PaintCode Support
Upvotes: 2
Reputation: 8512
Nice trick is to use Pattern Stroke with large Gap (like 1000) and attach variable to Dash attribute. This way you can create any bezier shape and animate it’s stroke as progress bar.
See this video: Animating Apple Watch Activity Rings (at around 3:40)
Upvotes: 0