拖动进入时突出显示按钮
刚刚开始探索iOS SDK。我有一些按钮,需要突出显示它们,触摸一次然后拖动。据我了解,当您单击按钮然后拖动到外部然后再次拖动到内部时,会触发 TouchDragEnter 事件。当您单击按钮外部然后拖动到内部时,是否会触发任何事件?
just started to explore iOS SDK. I have some buttons, need to highlight them touching outside once and then drag. As I understand, TouchDragEnter event fires when you click the button then drag outside then drag inside again. Is there any event fires when you click outside the button and then drag inside?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
亚历山大,
搜索相同的信息,我发现您的问题尚未得到解答。您可能已经明白了,但我是这样做的。
请注意,pointInside:withEvent: 方法检查该点是否位于按钮的边界内。由于触摸事件来自视图,因此您必须将其转换为按钮的坐标系。
Alexander,
Searching for the same info, I saw your question hadn't been answered. You've probably already figured it out, but here's how I've done it.
Note that the pointInside:withEvent: method checks to see if the point lies within the button's bounds. Since the touch event is coming from the view, you have to convert it to the button's coordinate system.