按钮动画(二)

来源:互联网 发布:java程序运行步骤 编辑:程序博客网 时间:2024/05/22 13:03

本节讲述旋转动画.(涉及到幅度、角度)

基本步骤:起始位置,终点位置。

CABasicAnimation* rotationAnimation = [CABasicAnimationanimationWithKeyPath:@"transform.rotation.z"];

   endValue = [selffetchResult];

    rotationAnimation.delegate =self;

    rotationAnimation.fromValue =@(startValue);

    rotationAnimation.toValue =@(endValue);

    rotationAnimation.duration =2.0f;

    rotationAnimation.autoreverses =NO;

    rotationAnimation.timingFunction = [CAMediaTimingFunctionfunctionWithName:kCAMediaTimingFunctionEaseInEaseOut];

    rotationAnimation.removedOnCompletion =NO;

    rotationAnimation.fillMode =kCAFillModeBoth;

    [_rotateStaticImageView.layeraddAnimation:rotationAnimationforKey:@"revItUpAnimation"];

根据  http://code4app.com/ios/大转盘抽奖/53ce002b933bf0a3648b4eb7  总结。
0 0
原创粉丝点击