recherche

Maison  >  Questions et réponses  >  le corps du texte

La propriété ios autoreverses exécute l'animation à l'envers. Comment la rendre moins rapide ?

    CAAnimationGroup    *hybridlayerGroup =   [CAAnimationGroup
                                               animation];
    hybridlayerGroup.duration =   4.0f;
    hybridlayerGroup.removedOnCompletion  =   NO;
    hybridlayerGroup.fillMode =   kCAFillModeForwards;
    hybridlayerGroup.autoreverses =   YES;
    hybridlayerGroup.animations =   @[leftopactiyAnimation,leftboundsanimation];
    
    [leftshapeLayer addAnimation:hybridlayerGroup forKey:nil];
PHP中文网PHP中文网2808 Il y a quelques jours850

répondre à tous(1)je répondrai

  • PHP中文网

    PHP中文网2017-05-17 10:07:18

    你可以通过设置CAAnimationGroup timingFunction属性 或者增加duration :CAAnimationGroup timingFunction属性 或者增加duration:

    hybridlayerGroup.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut];

    CA_EXTERN NSString * const kCAMediaTimingFunctionLinear;
    CA_EXTERN NSString * const kCAMediaTimingFunctionEaseIn;
    CA_EXTERN NSString * const kCAMediaTimingFunctionEaseOut;
    CA_EXTERN NSString * const kCAMediaTimingFunctionEaseInEaseOut;
    CA_EXTERN NSString * const kCAMediaTimingFunctionDefault;

    or

    hybridlayerGroup.duration = 9.0f;

    UIView animation...

    [UIView animateWithDuration:9.0f delay:0.0f 
     options:(UIViewAnimationOptionRepeat | UIViewAnimationOptionAutoreverse)    
    animations:^ {
        // ...
    } completion:nil];

    CA_EXTERN NSString * const kCAMediaTimingFunctionLinear;
    CA_EXTERN NSString * const kCAMediaTimingFunctionEaseIn;
    CA_EXTERN NSString * const kCAMediaTimingFunctionEaseOut;
    CA_EXTERN NSString * const kCAMediaTimingFunctionEaseInEaseOut;
    CA_EXTERN NSString * const kCAMediaTimingFunctionDefault; 🎜
    🎜ou🎜 rrreee 🎜Animation UIView... :🎜 rrreee

    répondre
    0
  • Annulerrépondre