MKPinAnnotationView 引脚的宽度和高度是多少(以像素为单位)?
编辑:更具体地说,iPhone屏幕上包含图钉的假想矩形的宽度和高度。
MKPinAnnotationView 引脚的宽度和高度是多少(以像素为单位)?
编辑:更具体地说,iPhone屏幕上包含图钉的假想矩形的宽度和高度。
根据下面的代码,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;
}