如何将地图视图中的图钉发送回调出视图?
我正在实现基于 MAPKit 的应用程序,因为我遇到了引脚显示的问题。有时它们会出现在 callOut 视图的顶部。我使用以下代码将引脚发回:
- (void)mapView:(MKMapView *)mapView didAddAnnotationViews:(NSArray *)views
{
for (MKAnnotationView* annotationView in views)
{
[mapView sendSubviewToBack:annotationView];
}
}
I am implementing MAPKit Based application, In that I had a problem with the pins display. Some times they are coming on top of the callOut view. I used the following code to send the pins back:
- (void)mapView:(MKMapView *)mapView didAddAnnotationViews:(NSArray *)views
{
for (MKAnnotationView* annotationView in views)
{
[mapView sendSubviewToBack:annotationView];
}
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在 IOS 5 和 IOS 6 中,我尝试了这个,
引脚永远不会重叠 CalloutView 是可以的。
我使用自定义 calloutview ,在文件 Base calloutView 中添加以下内容:
In
IOS 5
andIOS 6
, I try this and it's okthe pin never overlap CalloutView.
I use custom calloutview , in file Base calloutView I add this :
不记得标注气泡是否是annotationView的子视图,如果是以下应该可以工作......
如果您正在为 iOS 4.0 及更高版本编码,则可以使用这些
否则尝试在annotationView 内实现
希望这会有所帮助
Can't remember if the callout bubble is a subview of the annotationView, if it is the following should work...
If you're coding for iOS 4.0 and above you can use these
Otherwise try implementing inside the annotationView
Hope this helps