加载Gif动态图

作者: 江河_ios | 来源:发表于2017-12-26 11:20 被阅读23次

    简单介绍一个第三方UIImageView-PlayGIF.如何添加到项目不再介绍.......

    方法一 : 通过继承的方式

    YFGIFImageView *otherGIFView=[[YFGIFImageView alloc]init];

        otherGIFView.gifPath=[[NSBundle mainBundle] pathForResource:@"big.gif" ofType:nil];

        [otherGIFView startGIF];

        [self.view addSubview:otherGIFView];

    方法二 : 类别的方式

        UIImageView *gifImgView=[[UIImageView alloc]init];

        gifImgView.backgroundColor=[UIColor yellowColor];

        gifImgView.gifPath = [[NSBundle mainBundle] pathForResource:@"big.gif" ofType:nil];

        [gifImgView startGIF];

        [self.view addSubview:gifImgView];

    相关文章

      网友评论

        本文标题:加载Gif动态图

        本文链接:https://www.haomeiwen.com/subject/capdgxtx.html