Anand
Anand

Reputation: 1973

stop scrolling tableview while animating

How to stop table which scrolling immediately when I press a button.

I have tried this way.

 -(IBAction)buttonPressed:(id)sender {
             if([mTableview isDecelerating]) {
                  isTableScrolling = YES;
   }
 }



-(void)scrollViewDidScroll:(UIScrollView *)scrollView                                           
{
    if(isTableScrolling)
     {

    [mTableView setScrollEnabled:NO];
    [mTableView setDecelerationRate:0];
      }

}

But table stop's scrolling after some delay.

Upvotes: 3

Views: 826

Answers (1)

ultragtx
ultragtx

Reputation: 957

Try [self setContentOffset:self.contentOffset animated:NO]

Upvotes: 6

Related Questions