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應用程式任何幫助將非常感謝