【问题标题】:How to play animation/movie instead of iPhone splash screen?如何播放动画/电影而不是 iPhone 闪屏?
【发布时间】: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


    【解决方案1】:

    如果您询问的是经过批准的 App Store 应用程序,那么不,您只能使用静态 Default.png。

    如果您正在为越狱手机编写应用程序,这可能是可能的(但我不知道)。

    【讨论】:

    • 我是一名 iPhone 开发人员,我想在我的应用启动时播放 Gif 动画。这就是我想做的全部
    • 您可以将 Default.png 文件设置为动画的第一帧,然后在应用准备就绪后在此之上启动动画。
    【解决方案2】:

    下面的代码应该进来 - (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 方法中加载您想要加载的屏幕。

    【讨论】:

      【解决方案3】:

      很遗憾,在最新的 iPhone 操作系统上无法做到这一点。使用符号链接的技巧目前被操作系统阻止。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2022-01-26
        • 2012-08-14
        相关资源
        最近更新 更多