开发者

making the transformed layer as normal state in ios

开发者 https://www.devze.com 2023-03-28 17:53 出处:网络
Hi all i am trying to use CATransform3D in my project.i seen some code snippet for transforming a layerthat is shown below.my question is after transforming the layer with below code how to get layer

Hi all i am trying to use CATransform3D in my project.i seen some code snippet for transforming a layer that is shown below.my question is after transforming the layer with below code how to get layer in the normal dimensions which means same as before transforming of the layer

 -(IBAction)animateThumbnail{
CATransform3D rotationAndPerspectiveTransform = CATransform3DIdentity;
rotationAndPerspectiveTransform.m34 = 1.0 / -500;
rotationAndPerspectiveTransform = CATransform3DRotate(rotationAndPerspectiveTransform,30.0f * M_PI / 180.0f , 0.0f, 1.0f, 0.0f);

[CATransaction begin]; 
[CATransaction setValue:[NSNumber numberWithFloat:3.0]forKey:kCATransactionAnimationDuration];
imageL开发者_如何转开发ayer.transform = rotationAndPerspectiveTransform;
[CATransaction commit];
}

can any one please post your way of transformation to get my layer should be in the normal state. Thank you in advance.


You could use +[CATransaction setCompletionBlock:] and set the transform to CATransform3DIdentity. Or, you could use a CAPropertyAnimation and set autoreverses to YES.

0

精彩评论

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