1

我在 MKMapView 的地图上有一个屏幕。如何将此屏幕复制到图像并像简单的 UIImageView 一样使用它。

4

1 回答 1

5

这可能有效;

UIGraphicsBeginImageContextWithOptions(MKMapView.bounds.size, MKMapView.opaque, 0.0);
[MKMapView.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
于 2012-04-23T03:22:44.410 回答