2015-10-10 143 views
2

我有一個嵌套在UIScrollView中的GMSMapView。我已經關閉了滾動功能爲GMSMapView中GMSMapView防止UIScrollView滾動

mapView.settings.tiltGestures = false 
mapView.settings.scrollGestures = false 
mapView.settings.rotateGestures = false 

但是,每當我試圖滾動的意圖是,將的UIScrollView滾動視圖,沒有任何反應。我能做些什麼來解決這個問題?

回答

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 
} 
} 
1

在迅速3.0

mapView.settings.setAllGesturesEnabled(false)