Question

I have a custom NSView subclass that I want to animate with Core Animation. I am already (without CA) setting the position and rotation of these views with NSView's setFrameOrigin and setFrameRotation methods. However, no matter what I do, once I add a layer backing to the views I can't get them to rotate.

I've tried using NSView's setFrameRotation and setFrameCenterRotation methods. The latter moves the view a bit, but doesn't rotate its content. The former has no effect. Applying a CATransform3D created by CATransform3DRotate to the view's layer also has no effect.

I'm feeling a little dumb asking this question, because it seems like something that should be easy, but for the life of me I can't figure out how to make it work. Someone, please make me smack my forehead at how easy it was. :)

Was it helpful?

Solution

Turns out that the superview needed to be layer-backed as well in order for this to work. Making that change fixed it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top