简体   繁体   中英

Setting center y position of a CALayer

I am using CATransform3DTranslate to create a carousel with some UIViews on the iphone by translating their layers. The problem I am having is that while z and x appear to be centered the y position appears to be registered at the top. When I translate the y position it is effected by a "camera" distorting them. Does anyone know what I would use to change this out so that all of the objects would rotate around the center point of the view?

Solved my own issue. I was just looking at this from the wrong perspective. All layers are translated relative to their view so moving the view's center to the middle of it's superview solved the issue.

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