ios - How do I apply an animation around a button? -
i have 30 sec of song being played when play button being played. want progress bar go around play button song being played. how this?
play = add[indexpath.row] let playbutton : uibutton = uibutton.buttonwithtype(uibuttontype.custom) as! uibutton playbutton.tag = indexpath.row let imageret = "playbutton" playbutton.setimage(uiimage(named: imageret), forstate: .normal) playbutton.frame = cgrectmake(236, 20, 100, 100) playbutton.addtarget(self,action: "playit:", forcontrolevents: uicontrolevents.touchupinside)
i'm assuming want this:
it cashapelayer path circle. start strokeend
of 0 , animate 1. can poll song's progress using nstimer at, say, 1-second intervals , calculate how of song has played, , set strokeend
fraction.
Comments
Post a Comment