开发者

Cocoa Touch animation delaying command

What is the command of delayin开发者_Go百科g an action to fade in an image?


Sounds like you want

+ (void)setAnimationDelay:(NSTimeInterval)delay

Use it like this (non-block based animations):

[UIView beginAnimations:nil context:nil];
[UIView setAnimationDelay:1.5];
myImage.alpha = 1.0;
[UIView commitAnimations];


For Delaying the action u can do in AppDelegation, didFinishLaunchingWithOptions

          [NSThread sleepForTimeInterval:2];

For Fade in and Fade out of Image. u can use custom methods for Fade and fade out

Better you could see this post http://iosdevelopertips.com/user-interface/fade-transition-fade-images-in-and-out.html


I find the new block-based animation methods on UIView pretty simple to work with:

https://developer.apple.com/documentation/uikit/uiview

You could do something like

UIImageView *yourPic;  // assume it exists
yourPic.opacity = 0.0;
[UIView animateWithDuration:1.0 animations:^
{
    yourPic.opacity = 1.0;
}
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜