如何在UIView中应用变换?

我已将下面的变换应用于UIView的图层,如下所示:

CATransform3D rotationAndPerspectiveTransform = CATransform3DIdentity; rotationAndPerspectiveTransform.m34 = 1.0 / -850; rotationAndPerspectiveTransform = CATransform3DRotate(rotationAndPerspectiveTransform, M_PI_4*1.1,0.0f, 1.2f, 0.0f); self.centerView.layer.transform = rotationAndPerspectiveTransform; 

但没有那么多成功我只想应用如下图所示的变换 在此处输入图像描述

任何帮助都会非常感激。 感谢您阅读我的问题

也许这可能会有所帮助

 CATransform3D t1 = CATransform3DIdentity; t1.m34 = 1.0/-850; t1 = CATransform3DScale(t1, 0.95, 0.95, 1); t1 = CATransform3DRotate(t1, 15.0f*M_PI_4/180.0f, 0, 1.2, 0); CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"transform"]; animation.toValue = [NSValue valueWithCATransform3D:t1]; animation.duration = 1; animation.fillMode = kCAFillModeForwards; animation.removedOnCompletion = NO;