lottie-ios 简单应用

2020-02-17  本文已影响0人  LD_左岸
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

上一篇 下一篇

猜你喜欢

热点阅读