Uiview 向前平移/收缩手势至mkmapview
我有一个UIViewController,它有一个MKMapView和一个位于mapView顶部的其他视图(比如PaintView) 当用户用按压手势触摸PaintView时,下面的mapview应该会响应(以及PaintView本身)。 当用户用平移手势触摸Paintview时,mapview不得响应。(平移手势用于绘画) 是否有可能将挤压手势转发到地图视图Uiview 向前平移/收缩手势至mkmapview,uiview,mkmapview,uigesturerecognizer,Uiview,Mkmapview,Uigesturerecognizer,我有一个UIViewController,它有一个MKMapView和一个位于mapView顶部的其他视图(比如PaintView) 当用户用按压手势触摸PaintView时,下面的mapview应该会响应(以及PaintView本身)。 当用户用平移手势触摸Paintview时,mapview不得响应。(平移手势用于绘画) 是否有可能将挤压手势转发到地图视图 [self.view addSubview:self.mapView]; [self.view addSubview:self.pain
[self.view addSubview:self.mapView];
[self.view addSubview:self.paintView];
UIPanGestureRecognizer* panRecognizer = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(pan:)];
[self.paintView addGestureRecognizer:panRecognizer];
panRecognizer.delegate=self;
UIPinchGestureRecognizer* pinchGesture = [[UIPinchGestureRecognizer alloc] initWithTarget:self action:@selector(pinch:)];
[self.paintView addGestureRecognizer:pinchGesture];
pinchGesture.delegate=self;
-(void)pan:(UIPanGestureRecognizer *)gesture
{
//do sth in the paintView
}
-(void)pinch:(UIPinchGestureRecognizer *)gesture
{
//forward pinch gesture to mapview
//do sth in paintview
}
我想这篇文章回答了你的问题