有没有办法知道用户移动滚动视图多少像素?
有没有一种特定的方法可以知道用户移动滚动视图多少像素?我会相应地动态调整文本视图的大小。
谢谢弗兰
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
查看 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.