【发布时间】:2016-02-17 01:45:35
【问题描述】:
我正在尝试了解如何像这样为我的UIView 创建深度感知:
我试过这段代码:
var rotationWithPerspective = CATransform3DIdentity;
rotationWithPerspective.m34 = -1.0/500.0/2/2
rotationWithPerspective = CATransform3DRotate(rotationWithPerspective, 22.5, 0, 1, 0);
preview.layer.transform = rotationWithPerspective
产生透视。然而,它出于某种原因翻转视图。
1) 如何避免转换后的“翻转”?
2) 变换产生的“透视深度”是否与每个给定的UIView 相同,还是取决于UIView 的大小等?
谢谢!
【问题讨论】:
标签: ios swift object calayer catransform3drotate