cari

Rumah  >  Soal Jawab  >  teks badan

ios autoreverses menjalankan animasi secara terbalik Bagaimana untuk menjadikannya tidak begitu pantas?

    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中文网2743 hari yang lalu824

membalas semua(1)saya akan balas

  • PHP中文网

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

    你可以通过设置CAAnimationGroup 的timingFunction属性 或者增加tempoh: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;
    CAMediaTimingFunctionEaseOut;
    NCStringEaseOut;
    CA_EXTERN NSString * const kCAMediaTimingFunctionDefault;🎜
    🎜atau🎜 rrreee 🎜UIView animasi...:🎜 rrreee

    balas
    0
  • Batalbalas