• 启动画面的splash效果


    通常我们会在自己应用中添加一个名为Default.png的图片作为启动画面,这样做可以在我们程序启动加载时给用户一个友好的体验!
    同样我们可以给这个启动画面添加一个漂亮的Splash动画效果,这样会给用户带来更好的体验及趣味性!
    - (void)splashWithImageView:(UIImageView *)imageView {
      imageView.hidden = YES;
      CATransition *animation = [CATransition animation];
      animation.delegate = self;
        animation.duration = 2.0f;
          animation.timingFunction = UIViewAnimationCurveEaseInOut;
          animation.fillMode = kCAFillModeForwards;
          animation.type = kCATransitionFade; // @"rippleEffect", @"pageCurl";
          animation.subtype = kCATransitionFromLeft;
      [imageView.layer addAnimation:animation forKey:@"animation"];
    }
    我们只需要在程序启动时调用这个方法即可:
    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
      self.window.rootViewController = self.viewController;
        [self.window makeKeyAndVisible];
        UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0.0, 0.0, 320.0, 480.0)];
        imageView.image = [UIImage imageNamed:@"Default.png"];
        self.loginView = imageView;
        [self.window addSubview:imageView];
        [imageView release];
        [self performSelector:@selector(splashWithImageView:) withObject:imageView afterDelay:0.0];
    }
  • 相关阅读:
    基本数据类型(二)
    jquery 基础
    CSS 基础
    Hyperledger Fabric Ordering Service过程
    Hyperledger Fabric Transaction Proposal过程
    Hyperledger Chaincode启动过程
    Hyperledger Fabric1.0 整体结构
    golang学习
    数字签名详解
    设置MongoDB课程环境
  • 原文地址:https://www.cnblogs.com/top5/p/2506657.html
Copyright © 2020-2023  润新知