How to add animated splash screen in our application

前端 未结 4 1290
说谎
说谎 2020-12-13 22:39

How to add animated splash screen in our application.

4条回答
  •  忘掉有多难
    2020-12-13 22:59

    Old Answer:

    Well this is not possible yet. You can not make any Animation on Splash Screen. But you can make it via UIViewController class which will look like a Splash Screen. Remove the default.png image from your project by which user cant see the Default Splash Screen. Then in your first ViewController class you can make an animation using an array of images as was told above already. And in viewDidLoad: method make a NSTimer then hold the View according to you. After finish the time limit of NSTimer navigate your next ViewController view.

    Edit:

    I found an alternative solution to make it animated. We can show a .gif image in webView and it looks perfect!

    NSString *imagePath = [[NSBundle mainBundle] pathForResource: @"animated" ofType: @"gif"];
    NSData *data = [NSData dataWithContentsOfFile:imagePath];
    [self.webView setUserInteractionEnabled:NO];
    [self.webView loadData:data MIMEType:@"image/gif" textEncodingName:nil baseURL:nil];
    

    Make this view as a rootView of your app and after few delay navigate your next View. Remember make its userIntractionEnabled: false i.e. user cant scroll it.

    Full description see here Animated Splash Screen in iPhone

提交回复
热议问题