문제

Hi I`m working with CATransform3D. Every time that I call the following method with the variable radian the UIImageView is rotated “radian * M_PI” from the previous angle. I trying to go back to the original state. There is any way to do that? I mind I want to sent a radian value i.e. 10 and that the view maintain these angle if is called more than once.

METHOD:


CATransform3D rotatedTransform = self.needleB.layer.transform;
rotatedTransform = CATransform3DRotate(rotatedTransform, radian * M_PI / 180.0, 0.0f, 0.0f, 1.0f);
self.needleB.layer.transform = rotatedTransform;
self.needleB.layer.anchorPoint = CGPointMake(0.5, 0.9);
self.needleB.center = CGPointMake(160, 250);

Thanks !!

도움이 되었습니까?

해결책

To undo all transforms, assign the transform property of your layer to CATransform3DIdentity.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top