- (MKAnnotationView *)mapView:(MKMapView *)mV viewForAnnotation:(id <MKAnnotation>)annotation
{
MKPinAnnotationView *pinView = nil;
if(annotation != mapView.userLocation)
{
static NSString *defaultPinID = @"目的地";
pinView = (MKPinAnnotationView *)[mapView dequeueReusableAnnotationViewWithIdentifier:defaultPinID];
if ( pinView == nil )
pinView = [[[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:defaultPinID] autorelease];
pinView.pinColor = MKPinAnnotationColorPurple;
pinView.canShowCallout = YES;
pinView.animatesDrop = YES;
pinView.draggable=YES;
pinView.selected=YES;
}
else
{
[mapView.userLocation setTitle:@"I am here"];
}
return pinView;
}
帖子地址 http://www.cocoachina.com/bbs/read.php?tid-25338.html,欢迎讨论
本文介绍如何在iOS应用中实现手动添加大头针功能,通过点击屏幕即可放置大头针,并设置了动画效果及拖动功能。
1501

被折叠的 条评论
为什么被折叠?



