2
嗨,大家好我想旋转y,z轴上的视图我用下面的代码成功了,但我想旋转它的结尾,现在旋转从中央,我搜索,我得到了层的anchorPoint
财产,使其旋转,但它使我的观点不需要翻译也它不工作从y轴,z轴同时旋转视图结束
leftDoorView.layer.anchorPoint = CGPointMake(0.5,0);
// Code to rotate view on Y axis and slight translate on Z-axis
angle -= 1.57f;
[UIView animateWithDuration:0.5 animations:^{
CATransform3D transloate = CATransform3DMakeTranslation(0, 0, -(leftDoorView.frame.size.width/2.0));
CATransform3D rotate = CATransform3DMakeRotation(angle, 0, 1, 0);
CATransform3D mat = CATransform3DConcat(rotate, transloate);
leftDoorView.layer.transform = CATransform3DPerspect(mat, CGPointMake(0, 0), 500);
}];
欲了解更多信息我想使菜单效果喜欢Taasky应用程式任何帮助将非常感谢