Ben sınıflara göre özel açıklama görünümü yapmaya çalışıyorum MKAnnotationViewve geçersiz kılma drawRectyöntemi. Ben biraz gibi, görünüm ek açıklamanın konumundan ofset çizilir verilsin MKPinAnnotationViewpimin noktası yerine pimin orta daha belirtilen koordinatlarda olduğu şekilde, yapar. Aşağıda gösterildiği gibi Yani çerçeve konumunu ve boyutunu ayarlayın. Ben, hiç yalnız boyutu çerçevesinin konumunu etkileyebilir gibi Ancak, görünmüyor. Resim çekilmiş açıklama konumu üzerinde merkezlenmiş olan biter. İstediğimi elde etmek konusunda herhangi bir ipucu?
MyAnnotationView.h:
@interface MyAnnotationView : MKAnnotationView {
}
MyAnnotationView.m:
- (id)initWithAnnotation:(id <MKAnnotation>)annotation reuseIdentifier:(NSString *)reuseIdentifier {
if (self = [super initWithAnnotation:annotation reuseIdentifier:reuseIdentifier]) {
self.canShowCallout = YES;
self.backgroundColor = [UIColor clearColor];
// Position the frame so that the bottom of it touches the annotation position
self.frame = CGRectMake(0, -16, 32, 32);
}
return self;
}
- (void)drawRect:(CGRect)rect {
[[UIImage imageNamed:@blue-dot.png] drawInRect:rect];
}













