나는 RSS 피드 배열로 끝날 것이고, 라벨의 아래쪽에 그것들을 표시하기를 원할 것이다. 배열의 각 피드를 애니메이션으로 처리하고 싶습니다.UILabel 페이드 인/아웃 애니메이션하기
이것은 내가 지금까지 애니메이트 한 것입니다. 페이드를 위해 작동하지만 배열의 마지막 항목에만 애니메이션을 적용합니다.
feed = [[UILabel alloc] initWithFrame:CGRectMake(0,380,320,43)];
[self.view addSubview:feed];
feed.alpha=1;
NSArray *feeds = [NSArray arrayWithObjects:[NSString stringWithFormat:@"1234567"],[NSString stringWithFormat:@"qwerty"],[NSString stringWithFormat:@"asdfgh"],nil];
for (NSString* f in feeds){
feed.text=f;
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationCurve:UIViewAnimationCurveEaseIn];
[UIView setAnimationDuration:2.0f];
feed.alpha=0;
[UIView setAnimationDidStopSelector:@selector(animationDidStop:finished:context:)];
[UIView commitAnimations];
}
간단합니다.
감사합니다.
[UIView setAnimationDelegate : self]를 호출해야합니다. – joec
joec, 게시물이 정답입니다. 댓글 대신 답변으로 게시해야 크레딧을 얻을 수 있습니다. –