Question

i want to align my CALayer to be centered around a point that i get, but im not really that familiar with calayers, dont think they have a center property, ive had some luck with setting the whole frame but i only am given a point to do my positioning. any ideas on either how to get the rect from a point or better yet set the layers center?

thanks

Nick

Was it helpful?

Solution

You can use the position property. It depends on the anchorPoint property which defines where the it lies w.r.t to the frame. By default, anchorPoint is at the center of the frame and so position can be treated as the center of the frame. Unless you change the anchorPoint, you can use the position property. To be sure, read both of them in the documentation.

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