i wish to have a lable with te开发者_开发百科xt that appears and the slowly fades over a background image. and have a lable on the image with text but i wish it to stay for i second and then gradualy fade im using xcode and utalising interface builder. thanks
Well if you have a UIImage and UILabel linked from the Interface Builder, place the following in the viewdidload:
method:
// 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];
精彩评论