MKPinAnnotationView引脚的宽度和高度(以像素为单位)是什么?
编辑:更具体地说,iPhone屏幕上包含引脚的虚构矩形的宽度和高度。
答案 0 :(得分:24)
根据下面的代码,pin图像和MKPinAnnotationView都是32点宽,39点高:
- (MKAnnotationView *)mapView:(MKMapView *)mapView
viewForAnnotation:(id <MKAnnotation>)annotation
{
MKPinAnnotationView *pav = (MKPinAnnotationView *)[mapView
dequeueReusableAnnotationViewWithIdentifier:@"test"];
if (pav == nil)
{
pav = [[[MKPinAnnotationView alloc] initWithAnnotation:annotation
reuseIdentifier:@"test"] autorelease];
}
pav.annotation = annotation;
NSLog(@"pav.frame.size = %@, pav.image.size = %@",
NSStringFromCGSize(pav.frame.size),
NSStringFromCGSize(pav.image.size));
return pav;
}