开发者

iPhone Circular Progress Indicator [closed]

开发者 https://www.devze.com 2022-12-31 00:07 出处:网络
Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this
Closed. This question needs to be more focused. It is not currently accepting answers.

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 question

I'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.

0

精彩评论

暂无评论...
验证码 换一张
取 消