gpt4 book ai didi

ios5 - MKPointAnnotation : title always visible. 可能吗?

转载 作者:行者123 更新时间:2023-12-04 17:11:28 26 4
gpt4 key购买 nike

我添加标记和标题的代码是这样的:

MKPointAnnotation *annotationPoint = [[MKPointAnnotation alloc] init];
annotationPoint.coordinate = coord;
annotationPoint.title = currentTitle;
[mapView addAnnotation:annotationPoint];

是否可以在标记显示后立即在标记上显示标题并始终可见?
非常感谢

最佳答案

MKPointAnnotation *annotationPoint = [[MKPointAnnotation alloc] init];
annotationPoint.coordinate = coord;
annotationPoint.title = currentTitle;
[mapView addAnnotation:annotationPoint];
[mapView selectAnnotation:annotationPoint animated:NO];

或者
- (void)mapView:(MKMapView *)map didAddAnnotationViews:(NSArray *)views{

for (MKAnnotationView *av in views){

if ([av.annotation isKindOfClass:[MKPointAnnotation class]]){
[mapView selectAnnotation:av.annotation animated:NO];
break;
}

}

}

关于ios5 - MKPointAnnotation : title always visible. 可能吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11313919/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com