基本上我有我通过滚动表视图:以编程方式滚动表格视图并调整滚动时间?
[self.tableView scrollToRowAtIndexPath:indexPath
atScrollPosition:UITableViewScrollPositionTop
animated:YES];
但是,当我做到这一点春联真快,我希望它滚动速度稍慢。这如何实现?
基本上我有我通过滚动表视图:以编程方式滚动表格视图并调整滚动时间?
[self.tableView scrollToRowAtIndexPath:indexPath
atScrollPosition:UITableViewScrollPositionTop
animated:YES];
但是,当我做到这一点春联真快,我希望它滚动速度稍慢。这如何实现?
您也可以使用UIView动画,但传递NO作为方法的动画选项如下。通过改变动画的持续时间,你可以使其更慢或更快
[UIView animateWithDuration:0.5 animations:^(void){
[self.tableView scrollToRowAtIndexPath:indexPath
atScrollPosition:UITableViewScrollPositionTop
animated:NO];
}]
这与用动画滚动:YES是不一样的。当您使用内置滚动动画时,表格视图实际上会构建并显示动画中间(源和目标之间)的所有单元格。当您使用此解决方案时,表格视图不会显示屏幕外的单元格,而只是跳转到目标框架,并且该跳转会变成动画。你会注意到,如果你有一张慢动画的长桌,你会看到很多空白单元格。 – 2013-08-08 17:12:27
这里是另一种解决方案尝试这样。
[UIView animateWithDuration:5.0 animations:^{
//Move table view to where you want
[tableView setContentOffset:CGPointMake(0, 500)];
} completion:^(BOOL finished){
}];
http://stackoverflow.com/questions/3979119/uitableview-scroll-smooth-with-certain-speed – rptwsthi 2013-05-07 10:07:56
http://stackoverflow.com/questions/14780236/how-to-speed-up-滚动功能于UIScrollView的。 调整减速率。 – esh 2013-05-07 10:19:06