我有一个嵌套在UIScrollView中的GMSMapView。我已经关闭了GMSMapView的滚动功能
mapView.settings.tiltGestures = false
mapView.settings.scrollGestures = false
mapView.settings.rotateGestures = false
但是,每当我尝试滚动视图时意图UIScrollView将滚动,没有任何反应。我该怎么做才能解决这个问题?
答案 0 :(得分:6)
在swift 3.0中
mapView.settings.setAllGesturesEnabled(false)
答案 1 :(得分:0)
在UIScrollView中检测触摸手势(触摸 - >检测触摸了哪个视图,然后启用/禁用UIScroll视图的滚动。
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
CGPoint locationPoint = [[touches anyObject] locationInView:self.view];
CGPoint viewPoint = [myImage convertPoint:locationPoint fromView:self.view];
if ([mapView pointInside:viewPoint withEvent:event]) {
disable scrolling
}
}