MKPinAnnotationView image offset?

Does anyone know why the images used for MKPinAnnotationView should be slightly offset (up and to the right), the code I'm using:

pinView = [[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:pinView_ID];
pinView.image = [UIImage imageNamed: @"TEST_Small.png"];
// RedCircleImage = 40px x 40px 72dpi PNG
// GreenDotImage = 2px x 2px 72dpi PNG

alt text

Code changes do not change, just changing the file name for the image used, one image is “two red rings with a black dot in the center” and the other is a “little green dot”, which I added thin blue lines in Photoshop to show where is the green dot.

I checked the centerOffset property and set the value to 0,0 correctly

Any ideas are welcome.

+5
source share
1 answer

, MKAnnotationView MKPinAnnotationView. , centerOffset, . centerOffset , , .., -.

+14

All Articles