zoukankan      html  css  js  c++  java
  • 启动画面的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];
    }
  • 相关阅读:
    c语言分支和循环语句
    C语言基础知识
    磁盘管理-fdisk
    搭建Discuz
    KVM创建虚拟机相关操作
    WINRAR exe 捆绑 小游戏
    linux vi编辑器&文件目录管理
    灰鸽子木马的功能体验
    sqlalchemy 级联删除
    sqlalchemy 多对多
  • 原文地址:https://www.cnblogs.com/top5/p/2506657.html
Copyright © 2011-2022 走看看