0

Section用にUIViewを作成し、Row用に1回作成します。次に、メソッドを作成します。

-(void)startBlinking {
   [UIView setAnimationsEnabled:YES];
   [UIView animateWithDuration:5 delay:0.0 options:UIViewAnimationOptionAllowUserInteraction|UIViewAnimationOptionCurveEaseInOut animations:^
   {
        [self setBackgroundColor:[UIColor yellowColor]];
    } completion:^(BOOL finished)
    {
        [UIView animateWithDuration:5 delay:0.0 options:UIViewAnimationOptionAllowUserInteraction|UIViewAnimationOptionCurveEaseInOut animations:^
       {
           [self setBackgroundColor:[UIColor whiteColor]];
       } completion: NULL];
   }];
}

しかし、このメソッドを呼び出すと、アニメーションは表示されません。背景色はアニメーションなしで非常に速く変化します...:((WTF ??

イベントをキャッチする場合は、セクションと行に点滅する背景色の効果を作成する必要があります。

4

1 に答える 1

1

backgroundColor遷移はアニメートできません。セルにサブビューを追加してsubview.alpha = 0.0f、アニメーションブロックでアルファをに移行することをお勧めします1.0。これにより、目的の効果が得られます。

于 2012-10-30T15:09:27.357 に答える