我有UIScrollView
。我使用以下代码设置 contentOffset :
[UIView animateWithDuration:0.2 delay:0 options:UIViewAnimationOptionAllowUserInteraction | UIViewAnimationOptionCurveEaseOut animations:^{
[comicsScrollView setContentOffset:CGPointMake(comicsScrollView.contentOffset.x, currentView.frame.origin.y + currentView.bounds.size.height/2 - comicsScrollView.bounds.size.height/2) animated:NO];
} completion:^(BOOL finished) {
}];
进入
- (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate
方法和相同的代码进入
- (void)scrollViewWillBeginDecelerating:(UIScrollView *)scrollView
当我进行垂直滚动时 - 滚动指示器的行为不正确,它会跳跃或保持在先前的位置。
我的错误在哪里?