Wil*_*Hua 6 ios google-maps-sdk-ios swift
我有一个嵌套在UIScrollView中的GMSMapView.我已经关闭了GMSMapView的滚动功能
mapView.settings.tiltGestures = false
mapView.settings.scrollGestures = false
mapView.settings.rotateGestures = false
Run Code Online (Sandbox Code Playgroud)
但是,每当我尝试滚动视图时意图UIScrollView将滚动,没有任何反应.我该怎么做才能解决这个问题?
检测 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
}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2189 次 |
| 最近记录: |