【发布时间】:2013-06-25 19:49:24
【问题描述】:
我在地图上放置了大头针,当前位置以蓝点显示。我补充说:
- (MKAnnotationView *)mapView:(MKMapView *)amapView viewForAnnotation:(id<MKAnnotation>)annotation{
NSString *identifier =@"mypin";
MKPinAnnotationView *pin = (MKPinAnnotationView *) [amapView dequeueReusableAnnotationViewWithIdentifier:identifier];
if(pin ==nil){
pin = [[[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:identifier] autorelease];
}else{
pin.annotation = annotation;
}
UIButton *myDetailButton = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];
myDetailButton.frame = CGRectMake(0, 0, 23, 23);
myDetailButton.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;
myDetailButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentCenter;
[myDetailButton addTarget:self action:@selector(checkButtonTapped:) forControlEvents:UIControlEventTouchUpInside];
pin.rightCalloutAccessoryView = myDetailButton;
pin.enabled = YES;
pin.animatesDrop = TRUE;
pin.canShowCallout = YES;
return pin;
}
但现在当前位置是大头针而不是蓝点。如何阻止当前位置的注释成为图钉并将其保留为蓝点。
有什么帮助吗?
【问题讨论】:
-
如何给地图添加注释?
标签: ios mkmapview apple-maps