有没有办法知道用户移动滚动视图多少像素?

发布于 2024-10-07 03:36:53 字数 74 浏览 1 评论 0原文

有没有一种特定的方法可以知道用户移动滚动视图多少像素?我会相应地动态调整文本视图的大小。

谢谢弗兰

Is there a specific way to know how many pixels a user moves a scrollview? I would dynamically resize a textview accordingly.

Thanks

Fran

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

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

发布评论

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

评论(1

那请放手 2024-10-14 03:36:53

查看 UIScrollViewDelegate 协议参考 。具体检查响应滚动和拖动方法,从那里您可以检查滚动视图的 contentOffset 属性,该属性将为您提供距原点的 x 和 y 偏移量。

编辑:添加了 contentOffset 属性的正确名称。

Look at the UIScrollViewDelegate Protocol Reference. Specifically check the Responding to Scrolling and Dragging methods, from there you can check the contentOffset property of the scrollview which will give you the x and y offset from the origin.

EDIT: Added the proper name of the contentOffset property.

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