ios - My CALayer transform holds after animation, but the perspective disappears -


i have following code rotates calayer -45degrees on y axis:

#define d2r(x) (x * (m_pi/180.0))  - (void) swipe:(uiswipegesturerecognizer *)recognizer {             catransform3d transform = catransform3dmakerotation(d2r(-45), 0, 1.0, 0);     transform.m34 = -1.0 / 850;      cabasicanimation *transformanimation = [cabasicanimation animationwithkeypath: @"transform"];     transformanimation.fillmode = kcafillmodeforwards;     transformanimation.removedoncompletion = no;     transformanimation.tovalue = [nsvalue valuewithcatransform3d:transform];     transformanimation.duration = 0.5;      [self.layer addanimation:transformanimation forkey:@"transform"]; } 

the animation works, except ends no perspective - ignoring m34 setting if i'm understanding things correctly.

halfway through:

enter image description here

at end:

enter image description here

what doing wrong?

animation affects appearance of view during animation. doesn't applied view after animation ends. need yourself. i'm guessing right after adding animation work:

self.layer.transform = transform; 

you can right away, animation hide until animation completes.


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -