2012-07-02 21 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