这很奇怪,我想知道是否有人有任何想法?
我正在尝试滚动 UIScrollView 以响应 iPad 上的按钮按下。
如果我做:
CGPoint currentOff = scrollView.contentOffset;
currentOff.x+=240;
[scrollView setContentOffset:currentOff animated: NO];
滚动视图按预期跳转到所需位置,但我希望它滚动。但是,当我这样做时:
CGPoint currentOff = scrollView.contentOffset;
currentOff.x+=240;
[scrollView setContentOffset:currentOff animated: YES];
然后它什么也做不了!我有另一个滚动视图,它工作正常并按预期响应setContentOffset:YES
,所以我很困惑。任何关于为什么滚动可能不会发生的想法都非常受欢迎!
此外,在使用- (void)scrollViewDidScroll:(UIScrollView *)sender
时根本没有收到任何东西,animated:YES
但在使用时被调用animated:NO
!