0

I am currently using iOS 7's UIProgressView to keep track of user activity which progress both forward and backward. I am using the built-in animation settings such as: [self.myProgressBar setProgress: 0.50 animated: YES]. I notice that the animation works well when progressing forward, but when something cause the progress to go backwards (in the app there are several things the user could do to regress), the animation does not happen. I was wondering if there is a work around to this, or whether by design choice animation could only go forward and not backward.

Thanks!

daspianist
  • 5,336
  • 8
  • 50
  • 94
  • 1
    If you really think about it, I don't think many progress bars animate backwards anywhere. It's probably a design choice. Think about installers you see on your computer, they are always moving backwards without animations. This wouldn't be that hard to implement yourself, though, if you really want it. – borrrden Oct 25 '13 at 04:27
  • Thanks for the encouraging answer. How would you exactly implement it backwards though - I looked through the Apple documentation for UIProgressView and didn't find any element that I could modify... – daspianist Oct 25 '13 at 12:59
  • 1
    I've got a progress view that does just this. Have a look at [lightdesign/LDProgressView](http://github.com/lightdesign/LDProgressView) and let me know if that works for you. I'm currently doing it with a timer, but in version 2.0 I will likely move to CAAnimations. – Christian Di Lorenzo Oct 25 '13 at 23:27
  • Of course not, I was saying you would make it yourself from scratch. – borrrden Oct 26 '13 at 04:32

1 Answers1

0

Although this may not answer the question directly, for anyone wondering how to invert the component's start and end point. Simply use CGAffineTransformMakeScale:

[yourProgressView setTransform:CGAffineTransformMakeScale(-1.0, sy)]

The -1.0 will rotate it and progress will be set backwards. sy refers to the scale on the y axis, normally it would be 1.0, if you want to modify the height of the component you could set it to more.

mirceamironenco
  • 352
  • 2
  • 10