我想创建一个UIImage来自MKMapView.我的地图在视图中正确显示,但UIImage生成的只是一个灰色图像.这是相关的片段.
UIGraphicsBeginImageContext(mapView.bounds.size);
[mapView.layer renderInContext:UIGraphicsGetCurrentContext()];
mapImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
Run Code Online (Sandbox Code Playgroud)
有谁知道如何UIImage使用MapKit?