이미지를 축소하고 이미지를 변경 한 다음 다시 크기를 조정하려고합니다. 이 완료되면 iPhone UIImageView로 스케일 애니메이션을 체인화하는 방법은 무엇입니까?
CABasicAnimation* shrink = [CABasicAnimation animationWithKeyPath:@"transform.scale"];
shrink.toValue = [NSNumber numberWithDouble:0];
shrink.duration = 1;
shrink.delegate = self;
[myImageView.layer addAnimation:shrink forKey:@"shrink"];
이 수축하게하고, 내가 이미지를 변경하고, 성장 촉진를 시작
- (void)animationDidStop:(CAAnimation *)theAnimation finished:(BOOL)flag
{
myImageView.image = [images objectAtIndex:image];
CABasicAnimation* grow = [CABasicAnimation animationWithKeyPath:@"transform.scale"];
grow.toValue = CGAffineTransformMakeScale(1,1);
grow.delegate = self;
grow.duration = 1;
[myImageView.layer addAnimation:grow forKey:@"grow"];
}
이 시뮬레이터에서 잘 작동하지만, 장치, 수축이 완료 될 때, 전체 크기의 오래된 이미지를 플래시 한 다음 grow 애니메이션이 새 이미지로 시작됩니다.
플래시를 없애는 방법을 알려주세요.
(나는 시도했다 "removedOnCompletion = NO;"를 첫 번째로 시도되는 완료 후 축소 크기와 동일한 AffineTransform를 설정하지만, 훨씬 운이 없었다.)평가 모든 팁은.
킬로바이트
편집 :
우수! 다음 설정 :
shrink.fillMode = kCAFillModeForwards;
shrink.removedOnCompletion = NO;
깜박임을 제거했습니다. 고마워, 벤!
우수! 다음 설정 : \t out.fillMode = kCAFillModeForwards; \t out.removedOnCompletion = NO; 깜박임을 제거했습니다. 고마워, 벤! – KevinButler