zoukankan      html  css  js  c++  java
  • 程序启动的时候,实现Default 图片向四周扩散的动画

    原理是作为在程序启动的代码里面生成一个UIImageView, 此view的图片就是程序中的Default.png图片。

    - (void)applicationDidFinishLaunching:(UIApplication *)application 

    [self showSplashView];

     





    - (void)showSplashView {
        splashView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 20, 320, 460)];
        UIImage *image = [[UIImage alloc] initWithContentsOfFile:[[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"Default.png"]];
        splashView.image = image;
    	[image release];
    	[window addSubview:splashView];
        [window bringSubviewToFront:splashView];
        [UIView beginAnimations:nil context:nil];
        [UIView setAnimationDuration:0.3];
        [UIView setAnimationTransition:UIViewAnimationTransitionNone forView:window cache:YES];
        [UIView setAnimationDelegate:self];
        [UIView setAnimationDidStopSelector:@selector(startupAnimationDone:finished:context:)];
        splashView.alpha = 0.0;
        splashView.frame = CGRectMake(-60, -40, 440, 600);
        [UIView commitAnimations];
    }
    
    - (void)startupAnimationDone:(NSString *)animationID finished:(NSNumber *)finished context:(void *)context {
        [splashView removeFromSuperview];
        [splashView release];
    }
    
    
    
    
    
    调用的时候:
    [self showSplashView];

  • 相关阅读:
    aidl 详解
    为什么我选择用 flutter
    hunting
    Dynamic programming
    android 微信开发交流群
    hash function 字符串哈希函数
    函数也可以看成是空间的变换
    语法树
    生活中的物理随处可见
    about coroutine
  • 原文地址:https://www.cnblogs.com/moshengren/p/1855965.html
Copyright © 2011-2022 走看看