IOS связанная и непрерывная анимация, как первый взгляд приложения Flipboard - PullRequest
0 голосов
/ 26 июня 2011

Вот мой код:

- (void)showother{
    backgroundA.alpha = 1.0;
    backgroundB.alpha = 0.0;

    [UIView beginAnimations:@"ken" context:NULL];
    [UIView setAnimationDuration:4];
    [UIView setAnimationDelegate:self];
    [UIView setAnimationCurve:UIViewAnimationCurveEaseIn];
    [UIView setAnimationDidStopSelector:@selector(showHideDidStop)];
    CGAffineTransform rotate = CGAffineTransformMakeRotation(0.00);
    CGAffineTransform moveLeft = CGAffineTransformMakeTranslation(0.9,0.9);
    CGAffineTransform combo1 = CGAffineTransformConcat(rotate, moveLeft);

    CGAffineTransform zoomOut = CGAffineTransformMakeScale(1.5,1.5);
    CGAffineTransform transform = CGAffineTransformConcat(zoomOut, combo1);
    backgroundA.transform = transform;
    [UIView commitAnimations];
}

- (void)showHideDidStop{

    [UIView beginAnimations:@"fade" context:NULL];
    [UIView setAnimationDuration:4];
    backgroundA.alpha = 0.0;
    backgroundB.alpha = 1.0;
    [UIView setAnimationDelegate:self];
    [UIView setAnimationDidStopSelector:@selector(showother)];
    [UIView commitAnimations];

    backgroundA.image = [backgroundImageQueue objectAtIndex:0];
    backgroundB.image = [backgroundImageQueue objectAtIndex:[backgroundImageQueue count] - 1];
    [backgroundImageQueue insertObject:backgroundB.image atIndex:0];
    [backgroundImageQueue removeLastObject];
}        

Первая итерация анимации работает нормально, но позже запускается только вторая анимация. Где может быть проблема?

...