0
不叫上GMSmapview.I的touchesBegan方法,期待这种方法Touchbegan方法被触摸或拖动地图上叫。可有人让我知道什么是错,此代码不叫
#import "ViewController.h"
@interface ViewController()
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
[self.view setUserInteractionEnabled:YES];
_mapview.userInteractionEnabled=YES;
_mapview.settings.consumesGesturesInView = false;
}
- (void)touchesBegan:(NSSet<UITouch *> *)touches
withEvent:(UIEvent *)event{
NSLog(@"touchbegan started");
}
- (void)touchesMoved:(NSSet<UITouch *> *)touches
withEvent:(UIEvent *)event{
NSLog(@"touchesMoved started");
}
- (void)touchesEnded:(NSSet<UITouch *> *)touches
withEvent:(UIEvent *)event{
NSLog(@"touchesEnded started");
}
为什么你要使用的touchesBegan方法使用GMSMapView中mapdiddrag或mapdidtap方法 –
我想要得到的纬度第二日志,其中用户触摸map..can你提供有关如何做简单说明这 – tnishanth
'为(UIGestureRecognizer *识别器是KindOfClass:UIPanGestureRecognizer] {识别器.addTarget ...;}}''在这种情况下可能会有一些用处。 – Brandon