苹果手机开发:MapKit ,如何在没有针杆的情况下添加引脚



在 Mapkit 上,

我想知道是否可以添加一个没有茎的图钉,就像它只反映我们地图中的针头,而不是使用图像顺便说一句。

亲切的感谢,

是的,这是可能的。为此,您必须使用 MKAnnotationView 而不是 MKPinAnnotationView .并且不要使用 annotation.animatesDrop 属性。

以下是您可以在viewForAnnotation中使用的示例代码,

    annotation = [[MKAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:@"try"];
    annotation.canShowCallout = YES;
    annotation.image = [UIImage imageNamed:@"image.png"];

    return annotation;

希望这有帮助。

我看到你对堆栈溢出很陌生。确保将此答案或任何其他答案标记为正确答案。

相关内容

最新更新