为什么这个不起作用?我在targetContentOffset->y = -50.0f;
处设置了断点,它被触发了,但不确定为什么没有任何效果。
是的,paging = NO。
- (void)scrollViewWillEndDragging:(UIScrollView *)scrollView withVelocity:(CGPoint)velocity targetContentOffset:(inout CGPoint *)targetContentOffset {
if (scrollView.contentOffset.y < -50.0f) {
targetContentOffset->y = -50.0f;
}
else {
*targetContentOffset = CGPointZero;
// Need to call this subsequently to remove flickering.
dispatch_async(dispatch_get_main_queue(), ^{
[scrollView setContentOffset:CGPointZero animated:YES];
});
}
}
targetContentOffset->y = -50.0f;
没有效果。 - random