美文网首页
lottie-ios 简单应用

lottie-ios 简单应用

作者: LD_左岸 | 来源:发表于2020-02-17 15:24 被阅读0次
pod 'lottie-ios', '~>2.1.0'
#import <Lottie/Lottie.h>
 LOTAnimationView *giftAnimationView = [LOTAnimationView animationNamed:@"16221-cyper1"];
  giftAnimationView.frame = CGRectMake(10, 240, 350, 250);
    [self.view addSubview:giftAnimationView];
    giftAnimationView.backgroundColor = UIColor.cyanColor;
    
    __weak LOTAnimationView *weakGiftAnimationView = giftAnimationView;
    
    [giftAnimationView playWithCompletion:^(BOOL animationFinished) {
        
        [UIView animateWithDuration:0.5 animations:^{
            weakGiftAnimationView.alpha = 0.0;
        } completion:^(BOOL finished) {
            [weakGiftAnimationView removeFromSuperview];
        }];

        button.enabled = YES;
    }];

附json文件下载地址
666

相关文章

网友评论

      本文标题:lottie-ios 简单应用

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