MKMapView 未在平移上调用 RegionDidChangeAnimated
我有一个带有 MKMapView 的应用程序和每次地图更改位置时调用的代码(在 RegionDidChangeAnimated 中)。当应用程序最初加载时,在显式更新地图坐标的平移(滑动)、捏合、点击和按钮上调用regionDidChangeAnimated。加载其他视图并返回地图后,仅针对显式更新地图的点击和按钮调用regionDidChangeAnimated。平移地图和捏合不再调用regionDidChangeAnimated。
我看过这个stackoverflow帖子,它没有解决这个问题。该论坛在 devforums 和 iphonedevsdk 也不起作用。有谁知道导致这个问题的原因是什么?我没有向 MKMapView 添加任何子视图。
I have an app with a MKMapView and code that is called each time the map changes locations (in regionDidChangeAnimated). When the app initially loads, regionDidChangeAnimated is called on pans (swipes), pinches, taps and buttons that explicitly update the map coordinates. After loading other views and coming back to the map the regionDidChangeAnimated is only called for taps and the buttons that explicitly update the map. Panning the map and pinches no longer call regionDidChangeAnimated.
I have looked at this stackoverflow post which did not solve this issue. The forum posts on devforums and iphonedevsdk also did not work. Does anyone know what causes this issue? I am not adding any subviews to MKMapView.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我最初不想这样做,但到目前为止它似乎没有任何问题(取自相关的 devforums 帖子):
将 UIGestureRecognizerDelegate 添加到您的标题中。
现在添加版本号检查...如果我们使用的是 iOS 4,我们可以执行以下操作:
添加委托方法来处理手势:
I did not want to initially do it this way, but it appears to work with no problems so far (taken from devforums post in question):
Add the UIGestureRecognizerDelegate to your header.
Now add a check for the version number... If we're on iOS 4 we can do this:
Add the delegate methods to handle the gestures: