gpt4 book ai didi

iphone - 为什么当触摸次数改变时 touchesBegan 不触发?

转载 作者:太空狗 更新时间:2023-10-30 03:59:51 25 4
gpt4 key购买 nike

出于某种原因,我的 touchesBegan 方法似乎没有正确响应。如果我用两根手指触摸屏幕,然后抬起并再次放下,touchesBegan 会被正确调用。如果我用一根手指触摸屏幕,然后添加第二根手指,touchesBegan 不会像它应该的那样被调用。我需要检查一些标志吗?以下是说明我的问题的示例:

-(void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
NSLog(@"touch");
}

有什么想法吗?如果重要的话,我正在装有 iOS 4.2 的 iPad 上进行测试。

最佳答案

是的,您需要设置 multipleTouchEnabled您认为的属性(property)。

When set to NO, the receiver receives only the first touch event in a multi-touch sequence. The default value of this property is NO.

关于iphone - 为什么当触摸次数改变时 touchesBegan 不触发?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4466392/

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