Thursday, 15 January 2015

ios - Core Animation circle animation -



ios - Core Animation circle animation -

i have been trying create circular calayer rotate on center. have been able create rotate on wrong anchor point. have tried alter anchor point animation keeps same.

- (void)rotateimage { cabasicanimation* rotationanimation; rotationanimation = [cabasicanimation animationwithkeypath:@"transform.rotation.z"]; rotationanimation.fromvalue = [nsnumber numberwithfloat:0]; rotationanimation.tovalue = [nsnumber numberwithfloat: -m_pi*2]; rotationanimation.duration = 1; rotationanimation.repeatcount = infinity; [self.surroundingcircles addanimation:rotationanimation forkey:@"rotationanimation"]; }

result : https://www.dropbox.com/s/gmlxw1t2mle0au9/rotation.mov?dl=0

i had set frame of layer first:

self.surroundingcircles.frame = cgrectmake(0, 0, 22, 22);

ios rotation core-animation cabasicanimation

No comments:

Post a Comment