พรีมเบิล
ฉันได้ติดตั้งคำอธิบายประกอบแผนที่โดยใช้ MKMapView และ MapAnnotation เมื่อแตะมุมมองชื่อเรื่องจะปรากฏดังที่ปรากฎในภาพต่อไปนี้
ฉันได้ใช้ LOC ต่อไปนี้เพื่อใช้คำอธิบายประกอบแผนที่ดังกล่าว:
// VENUE 1 PIN.
CLLocationCoordinate2D venue1Location = CLLocationCoordinate2DMake(-27.5, 153.5);
MapAnnotation *venue1Pin = [[MapAnnotation alloc] initWithTitle:@"1 ONE ST" Location:venue1Location];
ดูวิธีการมอบสิทธิ์คำอธิบายประกอบ:
- (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id<MKAnnotation>)annotation
{
if ([annotation isKindOfClass:[MapAnnotation class]])
{
MapAnnotation *venueLocationAnnotation = (MapAnnotation *)annotation;
MKAnnotationView *venueLocationAnnotationView = [mapView dequeueReusableAnnotationViewWithIdentifier:@"customAnnotation"];
venueLocationAnnotationView.rightCalloutAccessoryView.hidden = YES;
if (venueLocationAnnotationView == nil)
venueLocationAnnotationView = venueLocationAnnotation.annotationView;
else
venueLocationAnnotationView.annotation = annotation;
return venueLocationAnnotationView;
}
else
{
return nil;
}
}
คำถาม
ฉันจะลบปุ่มข้อมูลออกจากมุมมองชื่อคำอธิบายประกอบแผนที่ดังกล่าวได้อย่างไร