Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/112.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 拖动后如何取消UIScrollView反弹动画?_Ios_Objective C_Uiscrollview - Fatal编程技术网

Ios 拖动后如何取消UIScrollView反弹动画?

Ios 拖动后如何取消UIScrollView反弹动画?,ios,objective-c,uiscrollview,Ios,Objective C,Uiscrollview,拖动后如何取消UIScrollView反弹动画?(不禁用反弹) 谢谢 在scrollView委托方法中设置内容偏移量ScrollViewWillendDraging:withVelocity:targetContentOffset: - (void)scrollViewWillEndDragging:(UIScrollView *)scrollView withVelocity:(CGPoint)velocity targetContentOffset:(inout CGPoint *)targ

拖动后如何取消UIScrollView反弹动画?(不禁用反弹)


谢谢

在scrollView委托方法中设置内容偏移量
ScrollViewWillendDraging:withVelocity:targetContentOffset:

- (void)scrollViewWillEndDragging:(UIScrollView *)scrollView withVelocity:(CGPoint)velocity targetContentOffset:(inout CGPoint *)targetContentOffset;
{
  scrollView.contentOffset = //.. content offset of where you want it to stop, use the current offset if you want it to stay where it is.
}

你的问题含糊不清,没有给我提供更多更好的答案,希望这能有所帮助。

像Dragresh这样的效果?如果是,您应该在scrollView结束时设置scrollView内容Inset拖动委托方法

[scrollView setContentOffset:scrollView.contentOffset animated:NO];
注意:必须使用函数的动画版本,而不是没有动画标志的版本