Resize MKAnnotationView Image When map zooms in and out?이 메도는 iOS5에서는 성공했지만 iOS6에서는 실패했습니다.iOS6에서 MKAnnotationView의 크기를 조정하는 방법은 무엇입니까?
MKAnnotationView의 변환이 직접 변경되어 행운이 없습니다. MKAnnotationView는 플래시로만 크기가 조정됩니다 (MKMapView 내부를 터치 업하면 터치 업 완료 후 MKAnnotationView가 원래 크기로 복원됩니다).
내 코드는 다음과 같습니다 :
- (void)mapView:(MKMapView *)mapView regionDidChangeAnimated:(BOOL)animated {
for (id <MKAnnotation>annotation in _mapView.annotations) {
// if it's the user location, just return nil.
if ([annotation isKindOfClass:[MKUserLocation class]])
continue;
// handle our custom annotations
//
if ([annotation isKindOfClass:[XPMKAnnotation class]])
{
// try to retrieve an existing pin view first
MKAnnotationView *pinView = [_mapView viewForAnnotation:annotation];
//resize the pin view
double zoomLevel = [_mapView getZoomLevel];
double scale = (1.0 * zoomLevel/16) + 0.5;
pinView.transform = CGAffineTransformMakeScale(scale, scale);
}
}
}
우리가 iOS6의에 MKAnnotationView의 크기를 조정할 수 있습니까? 아무도 몰라요?
에서 줌 레벨로 다시 조정. 마치 Transform이 AnnotationView에 대해 재설정 된 것처럼 계속 깜박입니다. 솔루션을 찾으면 여기에 게시됩니다. – Bach