Scrolling a horizontal UIScrollView in stepped increments?

前端 未结 3 957
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-04 23:51

I have a UIScrollView that can be scrolled horizontally. The scrollable content is displayed in columns.

Is there a way to make the scrolling only move in stepped in

3条回答
  •  佛祖请我去吃肉
    2021-01-04 23:52

    If you target iOS 5.0, you can use the new UIScrollViewDelegate method scrollViewWillEndDragging:withVelocity:targetContentOffset. This allows you to set the point where the scrolling animation will end after the user has stopped dragging the scroll view.

提交回复
热议问题