के लिए एक बटन प्रदर्शित मैं एक MKMapView
स्रोत कोड की इन पंक्तियों के साथ लागू किया (मेरे स्थान एक नीले रंग की गोली, एक दूसरे के बैंगनी पिन कर रहे हैं):MKMapView -> मेरे स्थान
- (MKAnnotationView *)mapView:(MKMapView *)mapViewLocal viewForAnnotation:(id <MKAnnotation>)annotation {
if (annotation == mapViewLocal.userLocation) {
mapViewLocal.userLocation.title = @"Test";
[mapViewLocal setRegion:MKCoordinateRegionMakeWithDistance(mapViewLocal.userLocation.coordinate, 1000, 1000) animated:YES];
return nil;
}
MKPinAnnotationView *pinView = (MKPinAnnotationView*)[mapViewLocal dequeueReusableAnnotationViewWithIdentifier:@"Pin"];
if(pinView == nil) {
pinView = [[[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:@"Pin"] autorelease];
pinView.pinColor = MKPinAnnotationColorPurple;
pinView.rightCalloutAccessoryView = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];
pinView.animatesDrop = NO;
pinView.canShowCallout = YES;
} else {
pinView.annotation = annotation;
}
return pinView;
}
बैंगनी पिन है एक विस्तार प्रकटीकरण बटन, लेकिन मेरी एनोटेशन में एक नहीं है। मैं ऐसा बटन कैसे सेट कर सकता हूं? , क्योंकि मैं एक अलग से निपटने की जरूरत है
-(void)mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)view calloutAccessoryControlTapped:(UIControl *)control
मैं अपने स्थान और अन्य सभी एक के बीच में कैसे फ़र्क हो सकता है:
और वह तरीका है, जहां मैं किसी चीज़ के लिए एक बटन pressd है कर सकते हैं। क्या कोई और प्रतिनिधि है या क्या मुझे कुछ प्रकार का खंड बनाना है?