开发者

stop scrolling tableview while animating

开发者 https://www.devze.com 2023-03-25 02:11 出处:网络
How to stop table w开发者_高级运维hich scrolling immediately when I press a button. I have tried this way.

How to stop table w开发者_高级运维hich 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.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消