问题
I'm looking to get a stateless/valueless UIProgressView or other kind of progress bar in iOS:
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.
回答1:
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.
回答2:
I just finished a UIProgressView subclass that's super easy to use (if progress == 0 activate barber pole effect). Hope this helps!
WNProgressView
回答3:
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
来源:https://stackoverflow.com/questions/9668989/ios-stateless-valueless-progress-bar