Mapkit 引脚颜色未改变
我正在执行以下操作,并且始终获得绿色引脚:
pin.pinColor = MKPinAnnotationColorRed;
[self.mapView addAnnotation:pin];
[pin release];
引脚的类型为“NSObject”。所有引脚均显示为绿色。我应该采取不同的做法吗?
I'm doing the following and always get green pins:
pin.pinColor = MKPinAnnotationColorRed;
[self.mapView addAnnotation:pin];
[pin release];
pin is of type "NSObject ". All pins come out as green. Should I be doing it differently?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
确保您的 pin 类实现 MKAnnotation 协议,我相信要获得非标准引脚颜色,您必须实现 viewForAnnotation 方法。
Make sure your pin class implements the MKAnnotation protocol and I believe to get a non-standard pin color, you'll have to implement the viewForAnnotation method.