首页 > 移动平台 > 详细

ios LaunchImage的延迟方法

时间:2016-06-01 21:23:14      阅读:465      评论:0      收藏:0      [点我收藏+]

1. 使用线程 延迟

在第一个加载页面

ViewDidLoad {

    [NSThread sleepForTimeInterval:3];

}

 

2.使用动画

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

    // Override point for customization after application launch.

    ViewController *ctr = [[ViewController  alloc] init];

    UINavigationController *navi = [[UINavigationController alloc] initWithRootViewController:ctr];

    self.window.rootViewController = navi;

    [self.window makeKeyAndVisible];

    

    NSString *viewOrientation = @"Portrait";

    CGSize viewSize = self.window.bounds.size;

    NSString *launchImg = nil;

    NSArray *imgDict = [[[NSBundle mainBundle] infoDictionary] valueForKey:@"UILaunchImages"];

    for (NSDictionary *dic in imgDict) {

        CGSize imgSize = CGSizeFromString(dic[@"UILaunchImageSize"]);

        if (CGSizeEqualToSize(imgSize, viewSize) && [viewOrientation isEqualToString:dic[@"UILaunchImageOrientation"]]) {

            launchImg = dic[@"UILaunchImageName"];

        }

    }

    

    UIImageView *launchView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"123"]];

    launchView.frame = self.window.bounds;

    launchView.contentMode = UIViewContentModeScaleToFill;

    [self.window addSubview:launchView];

    [UIView animateWithDuration:5 delay:0.5 options:UIViewAnimationOptionBeginFromCurrentState animations:^{

        launchView.alpha =0.0f;

        launchView.layer.transform = CATransform3DScale(CATransform3DIdentity, 1.2, 1.2, 1);

        

    } completion:^(BOOL finished) {

    

        [launchView removeFromSuperview];

    

    }];

    

    return YES;

}

ios LaunchImage的延迟方法

原文:http://www.cnblogs.com/tony0571/p/5550929.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!