自定义MKPointAnnotation的图像

时间:2013-08-19 10:33:47

标签: ios mkannotationview ios7

我有一段时间寻找某种方法来找到结果是这样的方式: http://i.stack.imgur.com/f78oz.png

- 但我输入方法,我想知道我是否将代码放在正确的位置,如果你可以帮助我,谢谢

- (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>)annotation
{

    MKPinAnnotationView *annView = [[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:@"SimpleTableIdentifier"];

    UIImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"arrow_right.png"]];

    annView.animatesDrop = TRUE;
    annView.canShowCallout = YES;
    annView.calloutOffset = CGPointMake(-5, 5);
    [annView addSubview:imageView];
    return annView;

}

0 个答案:

没有答案
相关问题