• 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
  • 相关阅读:
    fiddler抓取java系程序的网络通信
    ZOJ 2724 Windows Message Queue(优先队列)
    FZU 电动车通行证制度
    Havel定理
    Catch That Cow
    Trie树
    zoj 2876 Phone List
    zoj 2420
    getchar
    zoj 1315 Excuses, Excuses!
  • 原文地址:https://www.cnblogs.com/YuFly-lyx/p/6097967.html
Copyright © 2020-2023  润新知