zoukankan      html  css  js  c++  java
  • ios LaunchImage的延迟方法

    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;

    }

  • 相关阅读:
    s=a+aa+aaa+aaaa+aa...aaaa
    ibatis入门
    ibatis多参数的问题
    异步分页ajax
    8M的摄像头,30fps摄像时,60hz的LCD刷新频率,请问camera每秒向BB传输多少数据,如何计算
    android tcp通讯
    為什麼我的手機連Wi-Fi速度總是卡在75Mbps?Wi-Fi速度解惑~帶你一次看懂!
    mbps和MB/s是怎么换算的
    简说各种wifi无线协议的传输速率
    mil,mm与inch之间的转换
  • 原文地址:https://www.cnblogs.com/tony0571/p/5550929.html
Copyright © 2011-2022 走看看