SORU
26 Temmuz 2009, Pazar


MKPinAnnotationView: üçten fazla renk Vardır?

Apple docs göre, MKPinAnnotationView pın renk kırmızı, yeşil ve mor mevcuttur. Diğer renklerini de almak için herhangi bir yolu var mı? Doktorlar bir şey buldum.

CEVAP
26 Aralık 2009, CUMARTESİ


Aşağıdaki resim yararlı olabilir:

alt text alt text alt text alt text

ve bunları kullanmak için koduviewForAnnotation:

- (MKAnnotationView *) mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>) annotation
{   
    // ... get the annotation delegate and allocate the MKAnnotationView (annView)
    if ([annotationDelegate.type localizedCaseInsensitiveCompare:@"NeedsBluePin"] == NSOrderedSame)
    {
        UIImage * image = [UIImage imageNamed:@"blue_pin.png"];
        UIImageView *imageView = [[[UIImageView alloc] initWithImage:image] autorelease];
        [annView addSubview:imageView];
    }
    // ...

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • DeAdPiXel6667

    DeAdPiXel666

    2 Ocak 2010
  • wafflepwn

    wafflepwn

    14 AĞUSTOS 2008
  • wowchick16

    wowchick16

    17 Mart 2007