MKMapView 重新加载问题
我有一个包含 MKMapView 的控制器。当用户弹回到前一个控制器时我保留它,然后当用户想要返回地图时将其推回。当用户离开控制器时正在进行胺化时,就会出现此问题。当我重新按下控制器时,屏幕上的动画会冻结在弹出控制器时的状态。当用户触摸屏幕时,视图会更新并且正常。我尝试添加
[mapView setNeedsDisplay];
但没有运气。有什么想法吗?
I have a controller containing a MKMapView. I retain it when the user pops back to the previous controller and then push it back when the user want to return to the map. The problem occurs when an amination is in progress when the user leaves the controller. When I re push the controller the animation is on the screen frozen in the state it was in when the controller was popped. When the user touches the screen the view updates and is fine. I have tried adding
[mapView setNeedsDisplay];
with no luck. Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我最终通过切换当前位置注释来解决这个问题。这似乎迫使地图按照我需要的方式更新。
I ended up fixing this by toggling the current location annotation. This seems to force the map to update in the way I needed.
当我以编程方式滚动到某个位置时,即使视图没有离开,我也遇到了类似的问题。使用我想要的区域调用 regionThatFits: 似乎可以修复它,但我还没有调查原因。不确定这是否能解决您的问题,但也许值得一试?
I had a similar issue when I was programmatically scrolling to a spot in general, even if the view wasn't left. Calling regionThatFits: with the region I wanted seemed to fix it, but I haven't investigated why yet. Not sure if this would fix your issue, but worth a shot maybe?