iOS - 检测屏幕上有多个手指 [英] iOS - detect when more than one finger is on the screen

查看:554
本文介绍了iOS - 检测屏幕上有多个手指的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找在屏幕上检测多个手指的最佳方法。我没有检测到水龙头或捏,只是发生了不止一次触摸的事实。似乎没有任何手势识别器。什么是最好的方法?

I'm looking for the best way to detect more than one finger on the screen at time. I'm not detecting taps or pinching, just the fact that more than one touch is happening. There don't seem to be any gesture recognizers for that. What's the best way?

推荐答案

在touchesBegan,touchesMoved和touchesEnded方法中,一个参数是event,它是一个UIEvent对象。屏幕上的手指数是[[event allTouches] count]。

In the touchesBegan, touchesMoved, and touchesEnded methods, one parameter is event, which is a UIEvent object. The number of fingers on the screen is [[event allTouches]count].

将无效。]

这篇关于iOS - 检测屏幕上有多个手指的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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