문제

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

도움이 되었습니까?

해결책

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.

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