2014-11-03 4 views
2

안녕하세요, y 축의 뷰를 회전하려고합니다. 다음 코드는 성공했지만 지금은 회전 중입니다. 중심에서, 나는 검색하고 나는 그것이 회전 할 층의 anchorPoint 속성을 가지고 있지만, 그것은 또한 내가 Taasky가 도움이되는 앱과 같은 메뉴 효과를 확인하려면 추가 정보를 원하시면 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); 
     }]; 

작동하지 않습니다 내보기의 원치 않는 번역한다 정말 감사하겠습니다

답변

0

아마도 Ray Wenderlich Taasky 메뉴에 대한 자습서가 도움이 될 수 있습니다. 특히 "당신의 메뉴에 원근법 추가하기"섹션.

애니메이션에 대한 자세한 내용은 Apple 및 멋진 앵커 포인트 설명 David Ronnqvist으로 제공되는 설명서가 있습니다.

관련 문제