我有一个 View ,我对它的图层应用了转换 - 更改了 m34 字段,在 x 轴上旋转它并在 x 和 y 上缩放它。然后我将这个 View 添加到一个更大的 super View 中。我的问题是我添加到更大的 super View 的每个其他 View 都被转换后的 View 隐藏或重叠(如果新 View 的框架与转换后的 View 的框架相交),即使新 View 在层次结构中比转换后的 View 更高新 View 被添加到更大父 View 的 subviews
数组的末尾。任何想法这种行为背后的原因是什么? :-) 非常感谢!
最佳答案
3D 转换用于制作伪 3D。在这个 3D 空间中,您的层与其他层重叠。要改变它的 z-pozition 使用 CAlayer 的属性
@property CGFloat zPosition;
The layer’s position on the z axis. Animatable. The default value of this property is 0. Changing the value of this property changes the the front-to-back ordering of layers onscreen. This can affect the visibility of layers whose frame rectangles overlap. The value of this property is measured in points.
关于ios - 为什么转换后的 UIView 会与层次结构中更高层的其他 View 重叠?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23569933/