• IOS学习之路二十四(UIImageView 加载gif图片)


    UIImageView 怎样加载一个gif图片我还不知道(会的大神请指教),不过可以通过加载不同的图片实现gif效果

    代码如下:

    1. UIImageView* animatedImageView = [[UIImageView alloc] initWithFrame:self.view.bounds];  
    2. animatedImageView.animationImages = [NSArray arrayWithObjects:      
    3.                                [UIImage imageNamed:@"image1.gif"],  
    4.                                [UIImage imageNamed:@"image2.gif"],  
    5.                                [UIImage imageNamed:@"image3.gif"],  
    6.                                [UIImage imageNamed:@"image4.gif"], nil];  
    7. animatedImageView.animationDuration = 1.0f;  
    8. animatedImageView.animationRepeatCount = 0;  
    9. [animatedImageView startAnimating];  
    10. [self.view addSubview: animatedImageView];  


    转载请注明:

    新浪微博:http://weibo.com/u/3202802157

  • 相关阅读:
    macOS 修改键盘重复按键延迟
    stdout 与 stderr 区别
    E. 1-Trees and Queries
    Codeforces Round #615 (Div. 3)
    Codeforces Round 613(div 2)
    Codeforces Edu80
    SPOJ
    快读
    《货车运输》题解--最大生成树&倍增
    倍增思想求lca
  • 原文地址:https://www.cnblogs.com/lixingle/p/3324166.html
Copyright © 2020-2023  润新知