关闭

符合动画

227人阅读 评论(0) 收藏 举报
分类:

CABasicAnimation *opAnim = [CABasicAnimation animationWithKeyPath:@"opacity"];

    opAnim.duration = 3.0;

    opAnim.fromValue = [NSNumber numberWithFloat:.25];

    opAnim.toValue= [NSNumber numberWithFloat:1.0];

    opAnim.cumulative = YES;

    opAnim.repeatCount = 2;

    [_mTextField.layer addAnimation:opAnim forKey:@"animateOpacity"];

    

    CGAffineTransform moveTransform = CGAffineTransformMakeTranslation(180, 200);

    CABasicAnimation *moveAnim = [CABasicAnimation animationWithKeyPath:@"transform"];

    moveAnim.duration = 6.0;

    moveAnim.toValue= [NSValue valueWithCATransform3D:

                       CATransform3DMakeAffineTransform(moveTransform)];

    [_mTextField.layer addAnimation:moveAnim forKey:@"animateTransform"];


0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:324249次
    • 积分:5251
    • 等级:
    • 排名:第5404名
    • 原创:94篇
    • 转载:782篇
    • 译文:4篇
    • 评论:16条
    最新评论