를 이동, 애니메이션의 UIView 이동 나는 애니메이션으로 화면을 떨어져 그것을 이동하는 UIView 하위에 다음 코드가 있습니다아이 패드 : 다시
float currentX = xposition; //variables that store where the UIView is located
float currentY = yposition;
float targetX = -5.0f - self.width;
float targetY = -5.0f - self.height;
moveX = targetX - currentX; //stored as an instance variable so I can hang on to it and move it back
moveY = targetY - currentY;
[UIView beginAnimations:@"UIBase Hide" context:nil];
[UIView setAnimationDuration:duration];
self.transform = CGAffineTransformMakeTranslation(moveX,moveY);
[UIView commitAnimations];
그냥 잘 작동합니다. targetX/Y를 0으로 변경하여 실제로 지정된 점으로 이동했는지 확인합니다.
moveX = -moveX;
moveY = -moveY;
[UIView beginAnimations:@"UIBase Show" context:nil];
[UIView setAnimationDuration:duration];
self.transform = CGAffineTransformMakeTranslation(moveX,moveY);
[UIView commitAnimations];
이 약 3 배까지가해야와 UIView의 박았 : 나는 시도하고 다시 원래 어디까지보기를 이동할 때
문제
입니다. 따라서보기는 일반적으로 화면의 오른쪽에서 벗어납니다 (위치에 따라 다름).알고 있어야하는 CGAffineTransforMakeTranslation 기능이 있습니까? 나는 그 문서를 읽었고, 내가 말할 수있는 것으로부터, 내가 기대하고있는 일을해야만한다.
누구든지이 문제를 해결할 방법을 제안 했습니까? 감사.
Perfect. 어떻게 작동하는지 이해합니다. 빠른 답변 감사합니다. – Joel