uiscrollview在减速时留在内存中
我注意到一个小的内存泄漏问题,我想知道是否有一种防止它的方法。
如果您的卷轴浏览较长(例如tableview),并且向下滑动它会在停止之前持续一段时间(即惯性)。
现在,我注意到,如果您在ScrollView仍在降低卷轴时关闭ViewController,则直到(实际上)停止滚动才会降低卷轴。我注意到这永远不会超过1秒钟。
也许没什么大不了的,但是我仍然很好奇是否可以解决。我尝试在ViewDiddisAppear()和许多其他事情中停止滚动,但没有运气:(。
此问题似乎不适用于iOS 12,但它适用于iOS 14和15。
I noticed a small memory leak issue and I'm wondering if there is a way to prevent it.
If you have a long ScrollView (like TableView) and you swipe down it will keep scrolling for a while before it stops (i.e. inertia).
Now I noticed that if you close the ViewController while the ScrollView is still decelerating the ScrollView won't deinit until it (virtually) stopped scrolling. I noticed that this never takes more than 1 second.
Well no big deal maybe, but still I'm curious if this can be fixed. I tried stopping the scrolling in viewDidDisappear() and many other things but no luck :(.
This issue doesn't seem to apply to iOS 12, but it does to iOS 14 and 15.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论