Stop a UITableView from automatically scrolling

柔情痞子 提交于 2019-12-01 13:58:18

This is a subset of the classic problem of interrupting an existing animation and replacing it with a different animation.

The problem here is that if you merely remove the existing animation, you will jump to the end of that animation.

The solution to that is to consult the presentation layer and set the layer to that position before removing the existing animation. Now you are starting from midstream and can apply another animation.

Take a look at Kyle Truscott's excellent blog post about this for UIScrollView. UITableView inherits from UIScrollView, so in theory, it should work.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!