开发者

location different CGPoint

Hi how do I locate both the cgpoint? he gives me just one.

-(void)gestureLoad {

//GESTURE

UIGestureRecognizer *recognizer;


recognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(numTap2:)];
[(UITapGestureRecognizer *)recognizer setNumberOfTouchesRequired:2];
[self.view addGestureRecognizer:r开发者_开发知识库ecognizer];
self.tapRecognizer = (UITapGestureRecognizer *)recognizer;
recognizer.delegate = self;
[recognizer release];
}

- (void)numTap2:(UITapGestureRecognizer *)recognizer {


CGPoint location = [recognizer locationInView:self.view];


...other actions...
}

thanks a lot!


From the description of -[UIGestureRecognizer numberOfTouches]:

Using the value returned by this method in a loop, you can ask for the location of individual touches using the locationOfTouch:inView: method.

So, call -locationOfTouche:inView: for each touch to get the corresponding location.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜