您好,欢迎来到化拓教育网。
搜索
您的当前位置:首页POP的使用

POP的使用

来源:化拓教育网

pop是facebook提供的动画框架

// 添加标题
    UIImageView *sloganView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"app_slogan"]];
    [self.view addSubview:sloganView];
    
    // 添加动画
    POPSpringAnimation *anim = [POPSpringAnimation animationWithPropertyNamed:kPOPViewCenter];
    CGFloat centerX = BSScreenW * 0.5;
    CGFloat centerEndY = BSScreenH * 0.2;
    CGFloat centerBeginY = centerEndY - BSScreenH;
    anim.fromValue = [NSValue valueWithCGPoint:CGPointMake(centerX, centerBeginY)];
    anim.toValue = [NSValue valueWithCGPoint:CGPointMake(centerX, centerEndY)];
// 这两个属性结合使用
    anim.springBounciness = BSSpringFactor;
    anim.springSpeed = BSSpringFactor;

    anim.beginTime = CACurrentMediaTime() + BSCAnimationDelay * images.count;
    [anim setCompletionBlock:^(POPAnimation *anim, BOOL finished) {
       // 标题动画执行完毕, 恢复点击
        self.view.userInteractionEnabled = YES;
    }];
    [sloganView pop_addAnimation:anim forKey:nil];

Copyright © 2019- huatuo9.cn 版权所有 赣ICP备2023008801号-1

违法及侵权请联系:TEL:199 1889 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务