Come si gioca animazione / film, invece di splash screen iPhone?
-
21-09-2019 - |
Domanda
Voglio giocare un'animazione (Gif) oppure un film, invece di Default.png. È possibile? Ho provato quanto descritto in questo blog: http: //www.cuppadev.co.uk/iphone/playing-animated-gifs-on-the-iphone/ ma non so come giocare un'animazione Gif invece di Default.png
Soluzione
Se stai chiedendo circa un sanzionato App Store, allora no, non è possibile utilizzare tutto tranne che un Default.png statica.
Se si scrive un'applicazione per il telefono jailbroken, questo può essere possibile (ma non so).
Altri suggerimenti
Il seguente codice dovrebbe venire in - (BOOL) applicazione: (UIApplication *) didFinishLaunchingWithOptions di applicazione: (*) 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];
Nel metodo moviePlayerDidFinish caricare la schermata che si desidera caricare.
Purtroppo, è impossibile farlo sulla più recente sistema operativo di iPhone. Un trucco utilizzando link simbolico è attualmente bloccato da OS.