2012-08-27 7 views
1

에 나는 4 CABasicAnimationCAAnimationGroup로 분류했다. 그러나 문제는 각 애니메이션마다CAAnimation 위임은 CAAnimationGroup

이 호출되지 않는다는 것입니다.

CABasicAnimation *anim1;//code of anim1 
anim1.deleagte=self; 
CABasicAnimation *anim2://code of anim2 
anim2.deleagte=self; 
CABasicAnimation *anim3;//code of anim3 
anim3.deleagte=self; 
CABasicAnimation *anim4://code of anim4 
anim4.deleagte=self; 

CAAnimationGroup *animGrp;//code of animGrp 
animGrp.delegate=self; 
[imageView.layer addAnimation:animGrp forKey:@""]; 

오전 내가 뭔가 잘못하고 나에 대한 다른 접근 방법이있다.

내 목표는 모든 애니메이션에 대해 UIIImageView의 위치를 ​​변경하는 것입니다.

그래서 anim1이 끝나면 이미지를 변경하고 싶지만 animationDidStop 대리인을받지 못합니다.

답변

3

문서는 또 다른 하나가 완료되면

`CAAnimationGroup` allows multiple animations to be grouped and run concurrently 

이 가
Note: The delegate and removedOnCompletion properties of animations in the animations property are currently ignored. 

당신은 단순히 기간에 beginTime을 설정하여 그룹의 한 애니메이션을 시작하는 애니메이션의 beginTime를 사용할 수있는 상태 다른 애니메이션의 Time Warp in AnimationCAMediaTiming 프로토콜에서 상속 된 속성에 대한 훌륭한 설명을 제공합니다. 그러나 하나의 애니메이션을 레이어에 추가하고 위임을 사용하여 등록한 다음 첫 번째 애니메이션이 완료된 후에 레이어에 다른 애니메이션을 추가하는 것이 더 편리 할 수 ​​있습니다.

+0

설명해 주셔서 감사합니다. 귀하가 제안한 것과 동일한 방식으로 구현되었으며 효과가있었습니다. – andyPaul

관련 문제