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