我将最终得到一个RSS源数组,并希望标签或某些标签在视图的底部显示它们。我想通过数组中的每个Feed进行动画制作。动画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 2010-09-20 15:24:13
joec,你的帖子是正确的答案。您应该将其作为答案而不是评论发布,以便获得相应的评价。 – 2012-05-17 23:41:05