0

UIButtons の配列のアニメーションを縮小および展開する必要があります。単一の UIButton の場合、私はこのようにしています...

 UIButton *button = [self.destinationButtonsArray objectAtIndex:0];
 [UIView beginAnimations:@"shrink" context:(__bridge void *)(button)];
    [UIView animateWithDuration:0.7f delay:0 options:UIViewAnimationOptionAutoreverse |                UIViewAnimationCurveEaseInOut | UIViewAnimationOptionRepeat | UIViewAnimationOptionAllowUserInteraction  animations:^{

        [UIView setAnimationRepeatCount:3];

        CGAffineTransform t  = CGAffineTransformMakeScale(1.2f, 1.2f);
        button.transform = t;


    } completion:^(BOOL finished) {
        button.transform = CGAffineTransformMakeScale(1.0f, 1.0f);}];

UIbutons の配列に対して同じ効果を得るにはどうすればよいですか。

4

2 に答える 2

-1

for次のように、アニメーション ブロック内で a を使用します。

[UIView beginAnimations:@"shrink" context:(__bridge void *)(button)];
        [UIView animateWithDuration:0.7f delay:0 options:UIViewAnimationOptionAutoreverse |                            UIViewAnimationCurveEaseInOut | UIViewAnimationOptionRepeat |     UIViewAnimationOptionAllowUserInteraction  animations:^{

    [UIView setAnimationRepeatCount:3];

    CGAffineTransform t  = CGAffineTransformMakeScale(1.2f, 1.2f);

    for (UIButton button in self.destinationButtonsArray) {
        button.transform = t;
    }
} completion:^(BOOL finished) {
    for (UIButton button in self.destinationButtonsArray) {
        button.transform = CGAffineTransformMakeScale(1.0f, 1.0f);}];
    }
}];
于 2013-07-12T07:14:17.483 に答える