zoukankan      html  css  js  c++  java
  • 用UIImageView作出动画效果

    #import "AppDelegate.h"
    
    @interface AppDelegate ()
    
    @end
    
    @implementation AppDelegate
    
    
    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
        self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
        // Override point for customization after application launch.
        self.window.backgroundColor = [UIColor whiteColor];
        
        // 先把要播放的画面顺序排好
        NSMutableArray *imageArray = [[NSMutableArray alloc] init];
        for (int i = 0; i < 6; i++) {
            NSString *imageNames = [NSString stringWithFormat:@"run%d.tiff",i+1];
            UIImage *image = [UIImage imageNamed:imageNames];
            [imageArray addObject:image];
        }
        
        // 使用UIImageView 播放
        UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(100, 100, 120, 80)];
        imageView.animationImages = imageArray;
        // 播放一次动画所需的时间
        imageView.animationDuration = 1.0;
        // 设置播放的次数,其中0为一直播放
        imageView.animationRepeatCount = 0;
        // 开始动画
        [imageView startAnimating];
        
        [self.window addSubview:imageView];
        
        [self.window makeKeyAndVisible];
        return YES;
    }
    
    @end
  • 相关阅读:
    Asp.Net Mvc Filter
    使用 EntityFramework后把一个对象序列化成json字符串引起循环引用的问题
    RCTF2020 calc & EasyBlog & swoole
    GKCTF-EzWeb+redis未授权访问
    BJD3rd
    http走私
    网鼎杯2020青龙组 web writeup
    De1CTF 2020 部分web
    js相关trick总结
    xss常见编码解析
  • 原文地址:https://www.cnblogs.com/lantu1989/p/4601255.html
Copyright © 2011-2022 走看看