tetiklenen / aramadı calloutAccessoryControlTapped

oy
5

Benim uygulamada bu örneği kullanmış

http://spitzkoff.com/craig/?p=81

ama onun ı accessorycontrol aday olarak calloutAccessoryControlTapped tetikleme / aramayacağım.

İşte benim koddur.

- (void)viewDidLoad {
    MapAnnotation *annotation = nil;
    annotation = [[MapAnnotation alloc] initWithCoordinate:[[trackPointsArray objectAtIndex:trackPointsArray.count - 2] coordinate]];
    [mapView addAnnotation:annotation];
    [super viewDidLoad];
}

- (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>)annotation
{
    MKAnnotationView *annotationView = nil;

    // start pin
    static NSString *StartPinIdentifier = @StartPinIdentifier;
    MKPinAnnotationView *startPin = [annotationView dequeueReusableCellWithIdentifier:StartPinIdentifier];

    if (startPin == nil) {
        startPin = [[[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:StartPinIdentifier] autorelease];
        startPin.animatesDrop = YES;
        startPin.pinColor = MKPinAnnotationColorGreen;
        startPin.rightCalloutAccessoryView = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];
        startPin.canShowCallout = YES;
        startPin.enabled = YES;

        UIImage *image = [UIImage imageNamed:@location.png];
        UIImageView *imgView = [[UIImageView alloc] initWithImage:image];
        startPin.leftCalloutAccessoryView = imgView;
    }

    annotationView = startPin;
    return annotationView;
}

- (void)mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)view calloutAccessoryControlTapped:(UIControl *)control
{
     NSLog(@calloutAccessoryControlTapped);
}

Bir süre bu sorunla mücadele edilmiş, bir sürü insan yanı aynı sorun yaşıyor gibi görünüyor. Herhangi bir yardım mutluluk duyacağız. Teşekkürler

Oluştur 29/07/2009 saat 01:47
kaynak kullanıcı
Diğer dillerde...                            


1 cevaplar

oy
0

Sorun çözüldü! Benim diğer görünüm MapView engelliyordu. [Kendini setUserInteractionEnabled: no];

Cevap 29/07/2009 saat 01:57
kaynak kullanıcı

Cookies help us deliver our services. By using our services, you agree to our use of cookies. Learn more