小编V.D*_*V.D的帖子

CABasicAnimation 完成 1 个循环后返回其原始位置

不要引用CABasicAnimation 在下一个动画Objective-C之前返回到原始位置- CABasicAnimation 在动画之后应用更改?CABasicAnimation 旋转返回到 我尝试过的原始位置

below code does,bottom->top->goes left->back to it’s original position.
bottom->top->goes left->back to its original position.
I need bottom->top->goes left.bottom->top->goes left so on…

-(void)addUpDownAnimationForButton:(UILabel*)label
{
    CABasicAnimation * bottomAnimation ;
    bottomAnimation =[CABasicAnimation animationWithKeyPath:@"transform.translation.y"];
    [bottomAnimation setValue:@"animation1" forKey:@"id"];
    bottomAnimation.delegate = self;
    [UIView setAnimationDidStopSelector:@selector(animationDidStop:finished:)];
    bottomAnimation.duration = 2.0;
    bottomAnimation.fromValue = [NSNumber numberWithFloat:13];
    bottomAnimation.toValue = [NSNumber numberWithFloat:-7];
    bottomAnimation.repeatCount = 0;
    bottomAnimation.fillMode = kCAFillModeForwards;
    bottomAnimation.removedOnCompletion = NO;
    [btnSpecialForListing.titleLabel.layer addAnimation:bottomAnimation forKey:@"transform.translation.y"];
}
- (void)animationDidStop:(CAAnimation *)theAnimation2 …
Run Code Online (Sandbox Code Playgroud)

animation objective-c cabasicanimation ios

2
推荐指数
1
解决办法
2342
查看次数

标签 统计

animation ×1

cabasicanimation ×1

ios ×1

objective-c ×1