您好,我正在构建一个基于地图的应用程序,当我点击附件时,我对提供有关引脚位置的信息的个人资料页面执行 segue。现在我的 LeftCalloutAccesoryView 中有一张图片,我想在详细信息页面上显示它。现在我很好奇是否有一种方法可以获取在 LeftCalloutAccesoryView 上设置的图像。我动态添加图像。
我的附件控制窃听代码:
-(void)mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)view
calloutAccessoryControlTapped:(UIControl *)control
{
companytitle = view.annotation.title;
description = view.annotation.subtitle;
thumbprofileimage = view.image;
//thumbprofileimage = [(UIImageView *)view.leftCalloutAccessoryView setImage:pin.image];
//UIImageView *leftIconView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 30, 30)];
//leftIconView = [view.leftCalloutAccessoryView [[UIImageView alloc]];
//view.leftCalloutAccessoryView;
[self performSegueWithIdentifier:@"showPlattegrondDetails" sender:self];
}
我设置的引脚代码:
- (MKAnnotationView *)mapView:(MKMapView *)mpView viewForAnnotation:(id <MKAnnotation>)annotation {
static NSString *identifier = @"MyLocation";
if ([annotation isKindOfClass:[RouteAnnotation class]]) {
MKPinAnnotationView *annotationView =
(MKPinAnnotationView *)[mapView dequeueReusableAnnotationViewWithIdentifier:identifier];
if (annotationView == nil) {
annotationView = [[MKPinAnnotationView alloc]
initWithAnnotation:annotation
reuseIdentifier:identifier];
} else {
annotationView.annotation = annotation;
}
annotationView.enabled = YES;
annotationView.canShowCallout = YES;
leftIconView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 30, 30)];
[leftIconView setImage:pin.image];
annotationView.leftCalloutAccessoryView = leftIconView;
//annotationView.leftCalloutAccessoryView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 30, 30)];
UIButton *rightButton = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];
annotationView.rightCalloutAccessoryView = rightButton;
return annotationView;
}
return nil;
}
是否有人有获取图像参考的解决方案,以便我可以将此图像发送到详细信息页面?