zoukankan      html  css  js  c++  java
  • imageView加载gif图

    NSURL *fileUrl = [[NSBundle mainBundle] URLForResource:@"1" withExtension:@"gif"];
        CGImageSourceRef gifSource = CGImageSourceCreateWithURL((CFURLRef)fileUrl, NULL);
        size_t frameCout=CGImageSourceGetCount(gifSource);
        NSMutableArray* frames=[[NSMutableArray alloc] init];
        for (size_t i=0; i
            CGImageRef imageRef=CGImageSourceCreateImageAtIndex(gifSource, i, NULL);
            UIImage* imageName=[UIImage imageWithCGImage:imageRef];
            [frames addObject:imageName];
            CGImageRelease(imageRef);
        }
        
        UIImageView* imageview=[[UIImageView alloc] initWithFrame:CGRectMake(20, 64, 40, 40)];
        imageview.animationImages=frames;
        imageview.animationDuration=3;
        [imageview startAnimating];
        [self.view addSubview:imageview];
    (转自)http://blog.sina.com.cn/s/blog_8ded6a080102v4ux.html
  • 相关阅读:
    元素定位方法与等待
    xpath定位的总结
    模拟登录
    shell的数组
    shell的函数
    shell的循环
    shell的流程控制语句case
    shell的while循环
    shell的if条件判断
    shell的for循环
  • 原文地址:https://www.cnblogs.com/YuFly-lyx/p/6097967.html
Copyright © 2011-2022 走看看