iPhone 开发 - 无法在地图视图上显示用户的当前位置
我将mapView的showUserLocation属性设置为YES,但它什么也没做。我能够使用 CLLocationManager 将地图置于用户当前位置的中心,但屏幕上没有图钉/点。如何在地图上标记用户的确切位置?
I set the mapView's showUserLocation property to YES, and it does nothing. I was able to use a CLLocationManager to center the map on the user's current location, but there's no pin/dot on the screen. How can I put a pin on the map for the exact location of the user?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这已经让我搞砸了好几次,但它很容易解决
问题是你的代码是:
应该是:
还要确保你也设置了委托
This has messed me up several times but its an easy fix
The problem is that your code is:
Should be:
Also make sure you have set the delegate as well
在 Nib 名称中,您可以设置 showuserlocation 来标记 Mapview。
IN Nib name you can set showuserlocation to mark for Mapview.