【发布时间】:2014-09-02 13:34:58
【问题描述】:
我尝试快速为我的 MKPointAnnotation 创建一个自定义“徽章”,但它失败了,因为 MKPointAnnotation 没有像图像这样的任何属性
var information = MKPointAnnotation()
information.coordinate = location
information.title = "Test Title!"
information.subtitle = "Subtitle"
information.image = UIImage(named: "dot.png") //this is the line whats wrong
Map.addAnnotation(information)
有人想出了一个快速的解决方案吗?
【问题讨论】:
-
深入了解
MapKit,MKPointAnnotation不负责注释的显示。该功能由MKAnnotationView和MKMapViewDelegate处理
标签: ios swift mapkit mkpointannotation