Skip to content

Commit 000e87b

Browse files
committed
切换冒泡页面时,偶尔引发的Banner错位 - Bug
1 parent fbed4a0 commit 000e87b

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

Coding_iOS/Vendor/AutoSlideScrollView/AutoSlideScrollView.m

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,10 @@ - (void)longTapGestureAction:(UILongPressGestureRecognizer *)tapGesture
248248

249249
- (void)animationTimerDidFired:(NSTimer *)timer
250250
{
251-
CGPoint newOffset = CGPointMake(self.scrollView.contentOffset.x + CGRectGetWidth(self.scrollView.frame), self.scrollView.contentOffset.y);
251+
CGFloat width = CGRectGetWidth(self.scrollView.frame);
252+
CGFloat pX = self.scrollView.contentOffset.x;
253+
pX = nearbyint(pX/width) * width;//按照当前page坐标调整
254+
CGPoint newOffset = CGPointMake(pX + width, self.scrollView.contentOffset.y);
252255
[self.scrollView setContentOffset:newOffset animated:YES];
253256
}
254257

0 commit comments

Comments
 (0)