我正在实现一个基于 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];