내 앱에서 백그라운드에 애니메이션을 적용하려고합니다.백그라운드에 애니메이션을 적용하는 방법은 무엇입니까?
이미지가있는 이미지보기를 사용하고보기로드시 이미지를 스크롤하는 타이머가 시작되었습니다.
모두 괜찮아요, 저는 감소하고 이미지는 움직이는 것처럼 보입니다. 이미지 i가 0으로 X를 리셋 (800 픽셀 내 경우에는) 끝이 난 못생긴 애니메이션을 볼 때
하지만 ...
이 간단한 애니메이션을 해결하기 위해 더 좋은 방법이 있나요?[...]
[NSTimer scheduledTimerWithTimeInterval:0.1 target:self selector:@selector(scrollBackground) userInfo:nil repeats:YES];
[,,,]
int x = 0;
- (void) scrollBackground {
if (x <= -480) x = 0;
[background setFrame:CGRectMake(x--, background.frame.origin.y, background.frame.size.width, background.frame.size.height)];
}
감사
해결 방법 : CABasicAnimation animationWithKeyPath : @ "transform.translation.x"] – elp