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

回答

0

也許關於Taasky菜單的Ray Wenderlich教程可以提供幫助。特別是「添加透視到你的菜單」部分。

有關動畫的更多信息,還有Apple提供的文檔和David Ronnqvist的漂亮的定位點說明。