开发者

How to show an animated image in starting of application?

I am developing an application for client. In my application there is a requirement that when the application will start, firstly an animation should occur for some time then real application(view of appli开发者_如何学Ccation) should start.

But I don't know from where I should start and what code and where it should be write.


you can try it on

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 


You cannot display an animated GIF in an iPhone application directly. What you should do is extract the individual frames of the animation from the GIF save them as PNG files and then use UIImageView animation to perform the actual animation. Have a look at this.

Also have a look at this for a GIF splitter.


You need to do that in RootViewController.
Keep a view called companyView and show images fading in or out as you wish.
You can do that in viewDidAppear:


application didFinishLaunchingWithOptions:

UIImage* image=[UIImage imageNamed:@"splash.jpg"];
splashView=[[UIImageView alloc]initWithImage:image];
[window addSubview:splashView];
[window bringSubviewToFront:splashView];
[self performSelector:@selector(removeSplash) withObject:self afterDelay:2];
[window makeKeyAndVisible];

-(void)removeSplash{

[UIView beginAnimations:nil context:nil];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:window cache:YES];
[UIView setAnimationDuration:0.75];
[UIView setAnimationDelegate:self];
[splashView removeFromSuperview];
[UIView commitAnimations];
[window addSubview:viewController.view];
}


I think you will need to have your animation in video format and then use this documentation to play it.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜