Paste it into ViewController.m of the newly created single view project, and then drag a scrollview on the storyboard.
There is no predefined status for this.
UIScrollViewDelegate's - scrollViewDidScroll: will be called after the scrollview's visual range changes, which is closer to your description.
If
is not enough, implement it yourself and record the time when your finger moves in - scrollViewDidScroll:. Then monitor the difference between the current time and the recorded time. If it exceeds a certain time, it is considered that the finger has stopped.
- scrollViewWillBeginDragging: Will be called when starting dragging - scrollViewWillBeginDragging: 在开始拖动时会被调用 - scrollViewDidScroll: 在每次数据有一点变化时会被调用 - scrollViewWillEndDragging:withVelocity:targetContentOffset: Will be called every time the data changes a little - scrollViewWillEndDragging:withVelocity:targetContentOffset: Will be called when the finger is lifted.
When your finger does not move and does not leave the ScrollView, it will not respond to any ScrollView method.
I dragged and then stopped, but my finger didn’t leave. Is there any way to enter this state?
When scrollViewDidScroll 不响应时,而 scrollViewDidEndDragging does not respond, it means that your finger is not sliding, but it is still on the ScrollView.
Supplementary available codes, there should be a better way, for reference only:
Paste it into ViewController.m of the newly created single view project, and then drag a scrollview on the storyboard.
There is no predefined status for this.
UIScrollViewDelegate's
If- scrollViewDidScroll:
will be called after the scrollview's visual range changes, which is closer to your description.is not enough, implement it yourself and record the time when your finger moves in
- scrollViewDidScroll:
. Then monitor the difference between the current time and the recorded time. If it exceeds a certain time, it is considered that the finger has stopped.- scrollViewWillBeginDragging:
Will be called when starting dragging- scrollViewWillBeginDragging:
在开始拖动时会被调用- scrollViewDidScroll:
在每次数据有一点变化时会被调用- scrollViewWillEndDragging:withVelocity:targetContentOffset:
Will be called every time the data changes a little- scrollViewWillEndDragging:withVelocity:targetContentOffset:
Will be called when the finger is lifted.When your finger does not move and does not leave the ScrollView, it will not respond to any ScrollView method.
When
scrollViewDidScroll
不响应时,而scrollViewDidEndDragging
does not respond, it means that your finger is not sliding, but it is still on the ScrollView.