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

  • ChrisCrossMedia

    ChrisCrossMe

    17 EYLÜL 2009
  • Majestic Casual

    Majestic Cas

    28 NİSAN 2012
  • Mismag822 - The Card Trick Teacher

    Mismag822 -

    18 EKİM 2008