我可以预先知道它在滚动浏览之前停止的位置是否停止滚动

发布于 2025-02-03 21:04:25 字数 151 浏览 2 评论 0 原文

我可以提前知道滚动浏览在滚动停止之前将停止的位置吗?我已经咨询了相关的在线材料,但似乎没有相关的话题。我正在制作一个魔术应用程序,以知道在滚动浏览之前将在哪里滚动,以便我可以提前修改该值

:在开始放慢速度和停止时标记,但是它们之间的滑动距离尚不确定,所以我还没有结束我的想法

Can I know in advance where the Scrollview will stop before scrolling stop? I have consulted relevant online materials, but it seems that there is no relevant topic. I am making a magic app to know where it will scroll before Scrollview stops, so that I can modify the value there in advance

My attempt: mark when it starts to slow down and stop, but the sliding distance between them is uncertain, so I haven't finished my idea yet

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

沉默的熊 2025-02-10 21:04:26

有一个滚动视图委托法。

这将告诉您减速时的预期目标偏移。

它旨在用于更改目标偏移。例如,如果要确保它与完成的内容保持一致。

但是您不必更改它。您可以将目标偏移返回,但可以像您提到的那样更改内容。

There is a scroll view delegate method.

https://developer.apple.com/documentation/uikit/uiscrollviewdelegate/1619385-scrollviewwillenddragging

This will tell you the intended target offset when the deceleration finishes.

It is intended to be used to change the target offset. For instance if you want to make sure it aligns with the content you have tween it finishes.

But you don’t have to change it. You can just return the target offset but use that to change the content like you mentioned.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文