自定义大头针

来源:互联网 发布:软通动力java工资 编辑:程序博客网 时间:2024/06/06 13:38
-(MKAnnotationView *)mapView:(MKMapView *)theMapView viewForAnnotation:(id <MKAnnotation>)annotation {
      
    MKAnnotationView *newAnnotation=[[MKAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:@"annotation1"];
    if ([[annotation title] isEqualToString:@"当前位置"]) {
        newAnnotation.image = [UIImage imageNamed:@"person_location"];
    }
    else{
        newAnnotation.image = [UIImage imageNamed:@"login_logo_small"];
 
    }
    newAnnotation.canShowCallout=YES;
    return newAnnotation;
0 0
原创粉丝点击