UITableView w/ paging & momentum

后端 未结 1 1373
日久生厌
日久生厌 2021-02-06 17:00

OBSERVATIONS

I\'ve discovered some \"weird\" things about how UITableViews / UIScrollViews scroll in Objective-C for iOS after you\'ve lifted your fin

1条回答
  •  伪装坚强ぢ
    2021-02-06 18:04

    So this answer was obtained via a snarky but brilliant user on the #iphonedev IRC channel!

    From within scrollViewWillEndDragging:withVelocity:targetContentOffset: you can just re-set the targetContentOffset to whatever you desire via *targetContentOffset = newTargetOffset;! Incredibly simple and elegant.

    My mistake was trying to call [scrollview setContentOffset:newTargetOffset animated:YES] from within scrollViewWillEndDragging:withVelocity:targetContentOffset:, which didn't work at all, and therefore I set out to "solve" my problem in a more convoluted way that also didn't work at all.

    0 讨论(0)
提交回复
热议问题