Take the 2-minute tour ×

I'm trying to get my UITableView to slowly scroll downwards at a steady speed, which I can specify. I've used scrollToRowAtIndexPath, but whether or not I choose to animate it, it's an almost instant movement. I'm looking at something that moves much more slowly.

I did wonder whether I could do something with a UIView animation block, moving one indexPath.row at a time, but since my cells are different heights, this would cause uneven animation speed.

Any other ways I can do this?

share|improve this question

3 Answers 3

You can always decrement the contentOffset y axis over time.

share|improve this answer
That's exactly what I've just done :) –  lukech Feb 15 '13 at 22:24
up vote 0 down vote accepted

I got it with this..

[NSTimer scheduledTimerWithTimeInterval: 0.025 target:self selector:@selector(scrollTableView) userInfo:nil repeats:YES];


- (void) scrollTableView {

    float w = 1;

    CGPoint scrollPoint = self.tableView.contentOffset;
    scrollPoint.y = scrollPoint.y + w;
    if (scrollPoint.y >= self.tableView.contentSize.height - (self.tableView.frame.size.height - 100)  || scrollPoint.x <= -self.tableView.frame.size.height + 924) {
    w *= -1;
    [self.tableView setContentOffset: scrollPoint animated: NO];
share|improve this answer
Make sure you deal with the user interacting with the table while you do this as well as the user leaving the view controller. –  rmaddy Feb 15 '13 at 23:46

Here you go buddy. Just change the animateWithDuration to higher seconds like 1 or 1.5 to see if it achieves the effect you want. Make sure you include QuartzCore library and #import <QuartzCore/QuartzCore.h> in your *.m file. This is as easy as it gets


    [UIView animateWithDuration:0.5 delay:0.0 options:UIViewAnimationOptionCurveLinear animations:^{

            //here tblSimpleTable2 is tableView
            [tblSimpleTable2 setFrame:CGRectMake(183, 56, 137, 368)];

    } completion:nil];

share|improve this answer

Your Answer


