-1

Basically I have a table view that I scroll via:

 [self.tableView scrollToRowAtIndexPath:indexPath
                          atScrollPosition:UITableViewScrollPositionTop
                                  animated:YES];

But when I do this it scrolls really fast, and I want it to scroll a little slower. How can this be accomplished?

Cœur
  • 37,241
  • 25
  • 195
  • 267
MegaManX
  • 8,766
  • 12
  • 51
  • 83
  • http://stackoverflow.com/questions/3979119/uitableview-scroll-smooth-with-certain-speed – rptwsthi May 07 '13 at 10:07
  • http://stackoverflow.com/questions/14780236/how-to-speed-up-scrolling-in-uiscrollview. Adjust deceleration rate. – esh May 07 '13 at 10:19

2 Answers2

2

you can also use the UIView animation ,But pass NO for the animation option of the method as below. By changing the animation duration you can make it slower or faster

[UIView animateWithDuration:0.5 animations:^(void){
        [self.tableView scrollToRowAtIndexPath:indexPath
                          atScrollPosition:UITableViewScrollPositionTop
                                  animated:NO];
    }]
vignesh kumar
  • 2,310
  • 2
  • 25
  • 39
  • 2
    This is not the same as scrolling with animate:YES. When you use the built-in scrolling animation, the table view actually builds and displays all the cells in the middle of the animation (between source and destination). When you use this solution, the table view doesn't display the cells that are off-screen, and it just jumps to the destination frame, and that jump gets animated. You'll notice it if you have a long table with a slow animation, you'll see a lot of blank cells. – Moe Salih Aug 08 '13 at 17:12
1

here is another solutions try like this.

[UIView animateWithDuration:5.0 animations:^{
        //Move table view to where you want
         [tableView setContentOffset:CGPointMake(0, 500)];
    } completion:^(BOOL finished){
    }];
Balu
  • 8,470
  • 2
  • 24
  • 41