0

我正在实现一个基于 MKMapView 的应用程序。因为我使用的是自定义图像,而不是使用 MKAnnotationView.Image 属性来显示图钉。

它工作正常。但是我在海洋中显示的引脚显示有问题。当我使用默认引脚时,它工作正常。我不知道是什么问题。

cityAnnotationView = [[[MKAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:@"CityAnnotation"] autorelease]; 
//cityAnnotationView.image = [[UIImage imageNamed:@"city_pin.png"] stretchableImageWithLeftCapWidth:100 topCapHeight:10]; 
cityAnnotationView.image = [UIImage imageNamed:@"city_pin.png"];
cityAnnotationView.backgroundColor=[UIColor clearColor]; 
cityAnnotationView.annotation = annotation;
cityAnnotationView.canShowCallout = NO; 
cityAnnotationView.rightCalloutAccessoryView = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];
4

1 回答 1

0

您还需要设置注释位置。默认 (0,0) 位置确实在海洋中;)

于 2010-10-29T13:29:59.793 回答