【发布时间】:2014-08-22 19:21:28
【问题描述】:
我有一个工作循环来为某些工作数据点的标题和副标题元素设置注释。我想要在同一个循环结构中做的是将引脚颜色设置为紫色而不是默认值。我无法弄清楚的是我需要做什么才能进入我的 theMapView 以相应地设置引脚。
我的工作循环和一些尝试......
....
for var index = 0; index < MySupplierData.count; ++index {
// Establish an Annotation
myAnnotation = MKPointAnnotation();
... establish the coordinate,title, subtitle properties - this all works
self.theMapView.addAnnotation(myAnnotation) // this works great.
// In thinking about PinView and how to set it up I have this...
myPinView = MKPinAnnotationView();
myPinView.animatesDrop = true;
myPinView.pinColor = MKPinAnnotationColor.Purple;
// Now how do I get this view to be used for this particular Annotation in theMapView that I am iterating through??? Somehow I need to marry them or know how to replace these attributes directly without the above code for each data point added to the view
// It would be nice to have some kind of addPinView.
}
【问题讨论】:
标签: ios mkmapview swift mapkit mkannotationview