2012-07-02 17 views

回答

0

下面的代码工作正常改变UIAnnotationView的形象

  view = MKAnnotationView.alloc.initWithAnnotation(annotation, reuseIdentifier:ViewIdentifier) 
     view.image = UIImage.imageNamed("ptr.jpg") 
     view.canShowCallout = true 

我已经保存在文件夹中的资源的图像ptr.jpg。

1

一个完整的工作示例如何?我只是测试它:)

一个budy和我转换的iOS的代码有很多来自iOS的食谱,以RubyMotion

还有在地图上一整章,但是这看起来回答你的问题最好的一个是这样的:

https://github.com/IconoclastLabs/rubymotion_cookbook/tree/master/ch_6/06_custompins

这就像彩色针,但你的主要区别将是

pinImage = UIImage.imageNamed("ilpin.png") 
annotationView.image = pinImage 

古德勒克? ! - 来自Iconoclast Labs的Gant