Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this questionI'm trying to create a circular progress indicator like Shazam. It will represent progress during recording. There will be a finite amount of time and I want it to react to the sound level like Shazam's does. Any clues开发者_JS百科 where to begin?
Thanks
Subclass an UIView (maybe CircularProgress : UIView) and draw it manually with Quartz (paths, circles, etc) on the drawRect method passing the % of the progress as it changes.
I'm doing something similar here: https://github.com/DougFischer/DFCircleActivityIndicator
You can check my code and make something more appropriated. In my scenario, I'm drawing once and then I just rotate the image/layer. You'll need to animate the strokeEnd property using something like CABasicAnimation.
This property is animated and if you increase it from 0 to 1, you'll get the "filling effect". Again, in my scenario I need the empty center, probably you won't need it, your line width will be larger.
精彩评论