相关疑难解决方法(0)

动画UILabel淡入/淡出

我将最终得到一系列RSS提要,并希望在视图的底部显示标签或其他类似标签.我想为数组中的每个feed设置动画.

这是我到目前为止动画的内容,它适用于淡入淡出,但只能动画数组的最后一项.

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];

}
Run Code Online (Sandbox Code Playgroud)

我确定它很简单.

谢谢

iphone core-animation uiview uiviewanimation

0
推荐指数
1
解决办法
7207
查看次数

标签 统计

core-animation ×1

iphone ×1

uiview ×1

uiviewanimation ×1