繁体   English   中英

IOS MapView标注调整大小

[英]IOS MapView callout resize

目前我正在使用ios mkmapview来显示在地图上添加pin的poi,当用户点击pin时,默认的callout会出现并显示poi的标题,但是有些标题很长而且标注不够宽,无法完全显示标题。 我想要的只是让标注更宽,我该怎么做? 我搜索了几个小时的答案,但都是关于为callout实现自定义类,有没有办法只是重新调整大小而不进一步实现? 我想念一些明显的东西吗?

我几乎做了类似的事情。 因为我不喜欢地图上的正常标注,所以我创建了一个自定义标注。 在头文件中实现MKMapViewDelegate并在实现文件中声明方法(void)mapView:(MKMapView *)aMapView didSelectAnnotationView:(MKAnnotationView *)view 在此方法中,我创建一个显示注释内容的新视图。 添加UIButton以关闭此自定义视图。

//deselect the selected annotation
- (void)deselectAnnotation {
    selectedAnnotation = mapView.selectedAnnotations;
    for (int i = 0;i < selectedAnnotation.count; i++) {
        [mapView deselectAnnotation:[selectedAnnotation objectAtIndex:i] animated:NO];
    }
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM