2

I would like to start a picture at startup of my iPhone application (like a splash screen). But I would like to check in a spesific xml on the internet if this picture changed. If the picture is not the same I would like to download it locally to avoid downloading it each time. Do you know how I can do this? do you have a good tutorial?

Thanks

Laurent

4

1 回答 1

0

当您知道自己在做什么时,启动画面动画真的很酷。不幸的是,除了 iPod(我怀疑还有日历和消息)应用程序之外,无法更改应用程序的启动画面。所以……作弊。

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
        //inits and windows and such

        // Make this interesting.
        _splashView = [[UIImageView alloc] initWithFrame:CGRectMake(0,0, 320, 480)];
        //make Default.png some boring white or grey color
        _splashView.image = [UIImage imageNamed:@"Default.png"];

        coloredSplashView_ = [[UIImageView alloc] initWithFrame:CGRectMake(0,0, 320, 480)];
        coloredSplashView_.image = [UIImage imageNamed:@"colored_splash.png"];
        [coloredSplashView_ setAlpha:0.0f];

        [_window addSubview:_splashView];
        [_window addSubview:coloredSplashView_];
        [_window bringSubviewToFront:coloredSplashView_];

        [UIView animateWithDuration:1.00 delay:0.0 options:UIViewAnimationOptionCurveEaseIn animations:^{
            coloredSplashView_.alpha = 1.0;
            //make the splash visible
        }completion:^(BOOL finished) {
            //my personal touch: make it expand and fade out
            [_splashView removeFromSuperview];
            [UIView animateWithDuration:1.00 animations:^{
                [coloredSplashView_ setTransform:CGAffineTransformMakeScale(1.2, 1.2)];
                [coloredSplashView_ setAlpha:0.0f];
            }completion:^(BOOL finished){
                [coloredSplashView_ removeFromSuperview];
            }];
        }];    

    return YES;
}
于 2012-06-22T15:44:55.917 回答