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;

    }

  • 相关阅读:
    01 Jq 基础
    01 属性
    input 编辑框 光标 的相关问题
    登录页面 文字 2 3 4 个字 等宽俩端对齐 空格
    复选框单选框与文字对齐问题的研究与解决
    在Python中对MySQL中的数据进行可视化
    输入2个坐标的数值求出对应坐标间的距离和圆的面积
    numpy中arange函数内起始值必须大于结束值,否则生成为空的一维数组
    条件语句练习-比分预测
    三元表达式是棒棒哒!
  • 原文地址:https://www.cnblogs.com/tony0571/p/5550929.html
Copyright © 2011-2022 走看看