We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fbed4a0 commit 000e87bCopy full SHA for 000e87b
1 file changed
Coding_iOS/Vendor/AutoSlideScrollView/AutoSlideScrollView.m
@@ -248,7 +248,10 @@ - (void)longTapGestureAction:(UILongPressGestureRecognizer *)tapGesture
248
249
- (void)animationTimerDidFired:(NSTimer *)timer
250
{
251
- CGPoint newOffset = CGPointMake(self.scrollView.contentOffset.x + CGRectGetWidth(self.scrollView.frame), self.scrollView.contentOffset.y);
+ 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);
255
[self.scrollView setContentOffset:newOffset animated:YES];
256
}
257
0 commit comments