跨多个图像视图滑动手指 [英] Sliding finger across multiple image views

查看:42
本文介绍了跨多个图像视图滑动手指的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我动态创建了一个8x8图像视图的网格,上面显示了字母并为每个图像分配了标签.我可以通过Tap Gestures来检测每个图像视图上的触摸,但是我现在想要的是:如果用户滑动手指跨字母,我将能够获得每个图像视图标签.这样就可以检测到被触摸的字母(连续触摸).

I have dynamically created a grid of 8x8 image views over which letters are displayed and assigned the tag to each.I can detect the touch on each image view through Tap Gestures but what I want now is : if the user slide its finger across the letters, i would be able to get the each image view tag. So that the letters touched can be detected(the continuous touch).

请帮助

谢谢.

推荐答案

在单个图像视图上禁用用户交互,并处理包含它们的超级视图上的触摸.然后,您可以通过touchesMoved找出用户手指悬停在哪个图像上.

Disable user interaction on the individual image views and handle touches on the superview containing them instead. Then you can figure out which image the user's finger is over in touchesMoved.

这篇关于跨多个图像视图滑动手指的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆