当我们单击自定义注释图钉时,标注视图不会显示在视图中心,而是显示一半在视图中,其余显示在视图之外。请帮助我。提前致谢
CGSize const kMultiRowCalloutCellSize = {300,140};
- (id)initWithAnnotation:(id<MultiRowAnnotationProtocol>)annotation reuseIdentifier:(NSString *)reuseIdentifier onCalloutAccessoryTapped:(MultiRowAccessoryTappedBlock)block {
self = [super initWithAnnotation:(id<MKAnnotation>)annotation reuseIdentifier:reuseIdentifier];
if (self) {
self.contentHeight = 80.0;
_yShadowOffset = 6;
self.offsetFromParent = CGPointMake(78, -14); //this works for MKPinAnnotationView
self.enabled = NO;
self.backgroundColor = [UIColor clearColor];
self.cellInsetX = 15;
self.cellOffsetY = 10;
self.onCalloutAccessoryTapped = block;
[self setTitleWithAnnotation:annotation];
[self setCalloutCellsWithAnnotation:annotation];
}
return self;
}