Predicting the resting offset in a UIScrollView after deceleration

前端 未结 3 1173
臣服心动
臣服心动 2020-12-25 12:40

I would like to be able to predict the final resting offset within a UIScrollView after a flick gesture. It doesn\'t need to be pixel-accurate, but close enough so that the

3条回答
  •  失恋的感觉
    2020-12-25 13:10

    I cannot comment (I guess I need 50 rep), so this is not a full answer, but given the 0.998 and 0.990 values for deceleration, my instincts are that they simply multiply the current velocity by the deceleration rate each frame.

提交回复
热议问题