开发者

ipnoe development ..need to fade text over a back ground image

开发者 https://www.devze.com 2023-01-05 10:37 出处:网络
i wish to have a lable with te开发者_开发百科xt that appears and the slowly fades over a background image.

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

精彩评论

暂无评论...
验证码 换一张
取 消