Draw countdown circles

血红的双手。 提交于 2019-12-22 10:26:28

问题


I would like to draw, in a ViewController, a countdown like in the following image:

Unfortunately, I don't have any idea on how to realize this. I will be please if someone could give me a clue on this.

Cheers.

Cyril


回答1:


A quick thought, I would not like to draw it by using any iOS frameworks :), Just use small UIWebView and run javascript(Only works if user enables javascript, but hey I have seen no one yet who doesn't use javascript).

Javascript polar time can be found on internet, open source like,

http://oneorangesoftware.com/polartimer/

change and edit a bit and off you go! Awesome time!

Cheers!

If you don't like above approach than you may look into this code,

http://www.herbert-siojo.com/2011/04/19/drawing-a-countdown-timer-ios/

nicely crafted however to achieve same look as yours you may have to tweak a bit!

Beware of this line in code,

[self performSelector:@selector(cancelPie:) withObject:timer afterDelay:sliderIntervalDelay.value];

just change to,

[self performSelector:@selector(cancelPie:) withObject:timer afterDelay:60.0];

Credit : Goes to a developer who posted their code on http://www.herbert-siojo.com/2011/04/19/drawing-a-countdown-timer-ios/.




回答2:


LOL, I am considering to write one like this these days. You would definitely like this. :]

Check it out here: Circle-Counter-Down



来源:https://stackoverflow.com/questions/8263430/draw-countdown-circles

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!