【发布时间】:2012-08-22 15:27:33
【问题描述】:
我有一个水平表格视图,想每 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];
我意识到图像褪色太快了,我看到第二张图片滚动时没有褪色动画
【问题讨论】:
-
你能提供更多关于你想做什么和问题是什么的信息吗?!
-
请做一些截图来说明你的要求。
-
抱歉,编辑了我的帖子,希望对您有所帮助
-
我看不到任何截图。 :(
标签: iphone ios xcode uitableview uiviewanimation