即使按下按钮子视图,如何使滚动视图滚动
关于 UIScrollView、触摸事件和子视图有无数的问题,但我找不到一个可以解决我的困境的问题。我有一个带有延迟和可取消内容触摸的 UIScrollView,我在其中添加了 UIButton。我可以在触摸的任何地方(包括按钮)滚动视图,但如果我的手指在按钮上停留太久,它就会记录为触摸该按钮,正如我想要的和预期的那样。但是,如果我像尝试滚动一样移动手指,则滚动视图不会滚动 - 我怎样才能让它这样做?我想要实现的基本效果就像 UITableView 处理单元格的触摸一样。
感谢您的帮助。
There are countless questions about UIScrollView
s, touch events and subviews, but I couldn't find one that solved my dilemma. I have a UIScrollView
with delayed and cancellable content touches in which I have added UIButton
s. I can scroll the view wherever I touch (including the buttons), but if my finger lingers on a button for too long, it registers as touching the button, as I want and is expected. However, if I then move my finger as if trying to scroll, the scroll view does not scroll - how can I make it do so? The basic effect I am trying to achieve is like a UITableView
handles touches for the cells.
Thanks for your help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试在 UIScrollView 子类中实现以下内容:
Try implementing the following in your UIScrollView subclass: