水平のテーブル ビューがあり、5 秒ごとに画像を変更したいと考えています。古い画像がフェードアウトし、新しい画像がフェードインするように、フェードアニメーションで画像を変更したいので、このメソッドを呼び出します:
self.slideTimer = [NSTimer scheduledTimerWithTimeInterval:5
target:self
selector:@selector(slideToNextImage)
userInfo:nil
repeats:YES];
そして、これが私のものですslideToNextImage:
self.lastIndexPath = indexPath;
[UIView beginAnimations:@"FadeAnimations" context:nil];
[UIView setAnimationDuration:2];
self.horizontalView.alpha = 0.1f;
[self.horizontalView.tableView scrollToRowAtIndexPath:self.lastIndexPath
atScrollPosition:UITableViewScrollPositionMiddle
animated:NO];
[UIView commitAnimations];
[UIView beginAnimations:@"FadeAnimations" context:nil];
[UIView setAnimationDuration:2];
self.horizontalView.alpha = 1.0f;
[UIView commitAnimations];
私の認識では、画像のフェードが速すぎて、2番目の画像がフェードアニメーションなしでスクロールしているのがわかります