2009-12-17 11 views
0

J'ai une mapview et j'ai mis une annotation qui montre un titre personnalisé et une broche de sous-titre. Lorsque la visualisation de la carte commence, la broche est visible mais le titre et le sous-titre ne le sont pas. Je dois appuyer sur la broche pour afficher le titre et les sous-titres. Est-il possible de montrer le titre et le sous-titre sans appuyer sur l'épingle?Broche personnalisée avec sous-titre titre iphone

Répondre

0

cela est juste une suggestion mais vous pouvez essayer

[myCustomAnnotationView becomeFirstResponder]; 
+0

- (MKAnnotationView *) Mapview: (MKMapView *) Mapview viewForAnnotation: (id ) annotation { \t MKPinAnnotationView * newAnnotation = [[MKPinAnnotationView alloc] initWithAnnotation: annotation reuseIdentifier: @ "annotation1"] ; \t \t newAnnotation.pinColor = MKPinAnnotationColorGreen; \t newAnnotation.animatesDrop = TRUE; \t newAnnotation.canShowCallout = YES; \t \t [nouvelleAnnotation devenueFournisseurRéspondant]; \t return newAnnotation; } Je l'ai mis ici mais ça ne marche pas! – stefanosn

0

vous pouvez utiliser

MKMapView *mapView; 
    id<MKAnnotation> myAnnotation; 
    // initialize mapView and myAnnotation... 
    [mapView selectAnnotation:myAnnotation animated:YES] 
+0

Je l'essaie au simulateur est-il censé fonctionner? – stefanosn

+0

oui, j'ai utilisé cette méthode dans un certain nombre d'applications, d'où appelez-vous cela? –

Questions connexes