Skip to content

Commit 34a4ab4

Browse files
committed
make the cell content not bounce when there are no buttons
1 parent 1d78f29 commit 34a4ab4

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

SWTableViewCell/PodFiles/SWTableViewCell.m

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -569,6 +569,11 @@ - (void)scrollViewDidScroll:(UIScrollView *)scrollView
569569
scrollViewBounds.origin.x = MAX([self rightUtilityButtonsWidth] - scrollViewWidth, [self rightUtilityButtonsWidth] - scrollView.contentOffset.x);
570570
self.scrollViewButtonViewRight.bounds = scrollViewBounds;
571571
}
572+
else
573+
{
574+
[scrollView setContentOffset:CGPointMake([self leftUtilityButtonsWidth], 0)];
575+
self.tapGestureRecognizer.enabled = YES;
576+
}
572577
}
573578
else
574579
{
@@ -587,6 +592,11 @@ - (void)scrollViewDidScroll:(UIScrollView *)scrollView
587592

588593
self.scrollViewButtonViewLeft.frame = CGRectMake([self leftUtilityButtonsWidth], 0.0f, scrollViewWidth, self.height);
589594
}
595+
else
596+
{
597+
[scrollView setContentOffset:CGPointMake(0, 0)];
598+
self.tapGestureRecognizer.enabled = YES;
599+
}
590600
}
591601
}
592602

0 commit comments

Comments
 (0)