문제

iPhone Calayer를 사용하면 내 정신 레이어에 대한 회전 애니메이션을 원하지만 애니메이션 끝을위한 콜백을 원하십니까?

나는 아마도 카바 시카니 화를 사용해야한다고 생각하지만 카바 시카니 화를 사용하여 회전하는 방법을 모르겠다.

감사

도움이 되었습니까?

해결책

카니레이션 대의원을 설정하면 콜백 메소드를 추가 할 수 있습니다.

- (void)animationDidStop:(CAAnimation *)theAnimation finished:(BOOL)flag

애니메이션이 완료되면 호출됩니다. 이 링크에 따라 cgaffinetransform 변환 매트릭스를 통해 회전 애니메이션의 예를 찾으십시오.

http://iphonedevelopment.blogspot.com/2008/10/demystifying-cgaffinetransform.html

다른 팁

제쳐두고, 당신은 또한 다음 코드 블록에서 Uiview를 회전시키기 위해 호출을 마무리하여 Uiview 애니메이션에 대한 동일한 종류의 콜백을 수행 할 수 있습니다.

[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.5f];
[UIView setAnimationDelegate:self];
[UIView setAnimationDidStopSelector:@selector(rotationAnimationHasFinished:finished:context:)];
// Rotate the view here
[UIView commitAnimations];

그런 다음 대의원 방법을 정의합니다

- (void)rotationAnimationHasFinished:(NSString *)animationID finished:(BOOL)finished context:(void *)context;
{
// Handle the completion of the animation
}

애니메이션이 완료된 후 필요한 모든 것을 수행하는 대의원 내에서.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top