将 MKMapView 渲染到 UIImage 的代码在 iOS 7 中不再有效。它返回一个空图像,底部只有单词“Legal”,右上角有一个黑色指南针。地图本身不见了。下面是我的代码:
UIGraphicsBeginImageContext(map.bounds.size);
[map.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
Map 是一个指向 MKMapView 的 IBOutlet。有什么方法可以在 iOS 7 中正确呈现 MKMapView?