2014-11-03 115 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的漂亮的定位点说明。