leftCalloutAccessoryView
or rだけでなく、すべてのビューをタップ可能にしightCalloutAccessoryView
たい、中央もタップ可能にしたい
1231 次
2 に答える
2
あなたが使用することができます、
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
UITouch *touch = [touches anyObject];
CGPoint touchPoint = [touch locationInView:calloutView];
BOOL isPointInsideView = [calloutView pointInside:touchPoint withEvent:nil];
if (isPointInsideView)
{
// place your action code.
}
}
または、
UITapGestureRecognizer *tapGestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapCalloutAction:)];
tapGestureRecognizer.delegate = self;
tapGestureRecognizer.numberOfTapsRequired = 1;
[calloutView addGestureRecognizer:tapGestureRecognizer];
-(void) tapCalloutAction:(id)sender
{
// do stuff
}
于 2013-10-18T10:11:58.520 に答える