-1

我希望有一个带有文本的标签,并在背景图像上慢慢淡出。并在带有文本的图像上有一个标签,但我希望它停留一秒钟,然后使用 xcode 和 utalising interface builder 逐渐淡化我。谢谢

4

1 回答 1

1

好吧,如果你有一个从 Interface Builder 链接的 UIImage 和 UILabel,请将以下内容放在viewdidload:方法中:

// Starting state
myLabel.alpha=0.0;
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:1.0];
// Ending state
myLabel.alpha=1.0;
[UIView commitAnimations];

// Run another function to fade out after a second
[self performSelector:@selector(fadeOut:) withObject:sender afterDelay:1.0];    
于 2010-07-04T02:40:28.793 回答