3

I'm looking to get a stateless/valueless UIProgressView or other kind of progress bar in iOS:

enter image description here

I've tried looking up some documentation but couldn't find anything relevant to my issue.
If any of you have any recommendations i'd love to hear those :)

Thanks!
Shai.

Shai Mishali
  • 9,224
  • 4
  • 56
  • 83
  • there is the UIActivityIndicator(spinner), which is generally used where values cannot be determined for any activity... but it certainly doesnt look like that bar. – govi Mar 12 '12 at 14:34
  • Yeah , I'm aware of UIActivityIndicator but thats not what i'm looking for :) I'm looking for a UIProgressView that would act as an activity indicator. – Shai Mishali Mar 12 '12 at 14:35
  • 1
    ah! i think its possible to mimic the bar with a uiprogressbar(setting the trackimage and stuff and making the progress move to zero after it crosses a certain pixel), but that would kinda defeat the "progress" in the bar :D – govi Mar 12 '12 at 14:47
  • @govi I'll just go to a PNG Sequence, thanks anyways man! – Shai Mishali Mar 12 '12 at 14:52

3 Answers3

3

iOS's UIProgressView is designed specifically for that situation in which you know with certainty the percentage completed of your task. It only provides a 'fill-in' style presentation. You will not be able to use it for merely indicating an ongoing activity.

Ideas: use UIImageView's capacity for animating through an array of images. You could create just a few (three or four) variants on what I will call the 'barbershop pole' progress image and use those. Or... just take that animated gif you posted and put it in your UIImageView. It will work fine. If you want to stop animating it... just do something like

[myImageView setImage:stoppedImage];

If you really want to get fancy, you could write some subclass to do everything you want. But who has the time? Keep it simple!

Another thought

Why didn't I just suggest that you use the animated gif you posted above in your image view? It will work. And be rather easy.

QED
  • 9,803
  • 7
  • 50
  • 87
2

I just finished a UIProgressView subclass that's super easy to use (if progress == 0 activate barber pole effect). Hope this helps!

WNProgressView

n8chur
  • 111
  • 1
  • 3
  • 1
    This is really good, works like a charm and it's much cleaner that the suggested solution to use a set of images. – Martin Jul 26 '12 at 10:56
1

what about adding a UIImageView when the process begins? then hide it when finished? you will need to animate an image then. to do that. this one might help you

Community
  • 1
  • 1
janusfidel
  • 8,036
  • 4
  • 30
  • 53
  • I could use a PNG Sequence, but thats a last resort, I'd rather have some sort of a controller if one is available. – Shai Mishali Mar 12 '12 at 14:38