【发布时间】:2010-03-19 04:22:21
【问题描述】:
我想播放动画(Gif)或电影而不是 Default.png。那可能吗?我尝试了此博客中描述的内容:http://www.cuppadev.co.uk/iphone/playing-animated-gifs-on-the-iphone/ 但我不知道如何播放 Gif 动画而不是 Default.png
【问题讨论】:
标签: iphone objective-c animation splash-screen
我想播放动画(Gif)或电影而不是 Default.png。那可能吗?我尝试了此博客中描述的内容:http://www.cuppadev.co.uk/iphone/playing-animated-gifs-on-the-iphone/ 但我不知道如何播放 Gif 动画而不是 Default.png
【问题讨论】:
标签: iphone objective-c animation splash-screen
如果您询问的是经过批准的 App Store 应用程序,那么不,您只能使用静态 Default.png。
如果您正在为越狱手机编写应用程序,这可能是可能的(但我不知道)。
【讨论】:
下面的代码应该进来 - (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];
在moviePlayerDidFinish 方法中加载您想要加载的屏幕。
【讨论】:
很遗憾,在最新的 iPhone 操作系统上无法做到这一点。使用符号链接的技巧目前被操作系统阻止。
【讨论】: