开发者

Why does touchesBegan not fire when the number of touches changes?

开发者 https://www.devze.com 2023-01-30 19:44 出处:网络
For some reason my touchesBegan method doesn\'t seem to be responding correctly. If I touch the screen with two fingers, then lift one up and put it down again, touchesBegan gets called correctly. If

For some reason my touchesBegan method doesn't seem to be responding correctly. If I touch the screen with two fingers, then lift one up and put it down again, touchesBegan gets called correctly. If I touch the screen with one 开发者_如何学JAVAfinger, then add a second finger, touchesBegan does not get called like it should. Is there some flag that I need to check? Below is a sample that illustrates my problem:

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

Any ideas what's going on? I'm testing on an iPad with iOS 4.2 if it matters.


Yes, you need to set the multipleTouchEnabled property on your view.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消