How to play animation/movie instead of iPhone splash screen?

两盒软妹~` 提交于 2019-12-21 02:48:07

问题


I want to play an animation(Gif) or a movie instead of Default.png. Is that possible? I tried what is described in this blog :http://www.cuppadev.co.uk/iphone/playing-animated-gifs-on-the-iphone/ but I don't know how to play a Gif animation instead of Default.png


回答1:


If you're asking about a sanctioned App Store app, then no, you can't use anything but a static Default.png.

If you're writing an app for jailbroken phone, this may be possible (but I don't know).




回答2:


The Following code should come in - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions

NSBundle *bundle = [NSBundle mainBundle];
if(bundle != nil)
{
    NSString *videoPath = [bundle pathForResource:@"trail_video" ofType:@"mp4"];
    if (moviePath)
    {
        videoURL = [NSURL fileURLWithPath:moviePath];
    }
}

theMovie = [[MPMoviePlayerViewController alloc] initWithContentURL:videoURL];

theMovie.moviePlayer.controlStyle = MPMovieControlStyleNone;
theMovie.moviePlayer.scalingMode = MPMovieScalingModeFill;

[[NSNotificationCenter defaultCenter] addObserver:self
                                         selector:@selector(moviePlayerDidFinish:)
                                             name:MPMoviePlayerPlaybackDidFinishNotification
                                           object:theMovie.moviePlayer];

[theMovie.moviePlayer setFullscreen:YES animated:NO];
[theMovie.moviePlayer prepareToPlay];
[theMovie.moviePlayer play];
window.rootViewController = theMovie;
[self.window.rootViewController.view bringSubviewToFront:mMoviePlayer.moviePlayer.view];

In the moviePlayerDidFinish method load the screen which you desire to load.




回答3:


Unfortunately, it's impossible to do it on the latest iPhone OS. A trick using symbolic link is currently blocked by OS.



来源:https://stackoverflow.com/questions/2474960/how-to-play-animation-movie-instead-of-iphone-splash-screen

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!