gpt4 book ai didi

objective-c - 如何在 iOS 应用程序中启用多点触控?

转载 作者:行者123 更新时间:2023-12-03 20:49:23 36 4
gpt4 key购买 nike

这是代码:

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
if ([touches count] == 1) {
// code
} else {
// code
}
}

当我在模拟器中使用 Option 键模拟双击时,代码始终选择 if 语句的第一部分,就好像只收到了 1 次触摸。

为什么我没有收到两次触摸?

最佳答案

multipleTouchEnabled property需要设置为 YES, View 才能接受多点触控。

关于objective-c - 如何在 iOS 应用程序中启用多点触控?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2287102/

36 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com