简体   繁体   中英

UIView's center of rotation

Is there a counterpart to the CALayer's anchorPoint for a UIView?

I'd like to rotate my UIView around a point other than the center of the bounds.

Thanks.

To follow up on what Daniel said, according to the UIView documentation :

The origin of the transform is the value of the center property, or the layer's anchorPoint property if it was changed. (Use the layer property to get the underlying Core Animation layer object.)

Therefore, if you set the anchorPoint in the UIView's layer, transforms applied directly to the UIView will occur about that point.

不,如果您要执行此操作,则必须使用我敢肯定的图层

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM