Tag: catransform3drotate

不能再翻转层,CALayer,CATransform3DRotate。

我想要做的是做: 点击一个button来做垂直翻转。 再次点击一个button,图层将会翻转,等等… 代码如下: @interface ViewController (){ CALayer *plane; } @end @implementation ViewController -(void)viewDidLoad { [super viewDidLoad]; [self addALayer]; } – (void)addALayer{ plane = [CALayer layer]; plane.backgroundColor = [[UIColor orangeColor] CGColor]; //[plane insertSublayer:normalBackground atIndex:0]; plane.opacity = 1; plane.frame = CGRectMake(0, 0, 300, 100); plane.position = CGPointMake(250, 150); plane.anchorPoint = CGPointMake(0.5, 0.5); plane.borderColor = [UIColor whiteColor].CGColor; […]

CATransform3DRotate效果在应用锚点后消失

编辑正确的观察。 我使用以下两个片段来旋转UIImageView。 stage1后,我得到了所需的3D效果:视图旋转(3D效果)和拉伸(更大的尺寸)。 在舞台2上,我试图用右侧的铰链摆动右侧的视图。 如果我应用更改定位点的线,视图会正确摆动(右转),但是一个主要问题是:视图的大小恢复到原始大小(较小),而(旋转)3D效果仍然完好无损,然后摆动发生。 有什么build议么? rightView.layer.anchorPoint = CGPointMake(1.0, 0.5); -(void)stage1 { [UIView animateWithDuration:1.5 animations:^{ rightView.transform = CGAffineTransformMakeTranslation(0,0); //rightView i UIImageView CATransform3D _3Dt = CATransform3DIdentity; _3Dt =CATransform3DMakeRotation(3.141f/42.0f,0.0f,-1.0f,0.0f); _3Dt.m34 = -0.001f; _3Dt.m14 = -0.0015f; rightView.layer.transform = _3Dt; } completion:^(BOOL finished){ if (finished) { NSLog(@"finished.."); } }]; } -(void)Stage2 { rightView.layer.anchorPoint = CGPointMake(1.0, 0.5); //issue? rightView.center = […]