【发布时间】:2020-04-17 02:56:07
【问题描述】:
在我的 iOS 应用中,我打算使用以下代码获取我的 Google 地图地图的快照:
UIGraphicsBeginImageContext(self.mapView.frame.size)
if let context = UIGraphicsGetCurrentContext() {
self.mapView.layer.render(in: context)
}
self.imageSnapshot = UIGraphicsGetImageFromCurrentImageContext()
UIGraphicsEndImageContext()
但是,返回的图像是左下角带有 Google 徽标的黑屏图像。我该怎么做才能获得正确的地图图像快照?
【问题讨论】:
标签: ios swift google-maps screenshot google-maps-sdk-ios