如何为ios拍摄AGSMapView的快照?
他是我的代码,从上面的代码得到空白图像(白色)试试这个代码如何为ios拍摄AGSMapView的快照?,ios,swift,Ios,Swift,他是我的代码,从上面的代码得到空白图像(白色)试试这个代码 UIGraphicsBeginImageContextWithOptions(self.AgsMapView.bounds.size,false, 0.0) self.view.layer.renderInContext(UIGraphicsGetCurrentContext()!) snapShot = UIGraphicsGetImageFromCurrentImageContext()
UIGraphicsBeginImageContextWithOptions(self.AgsMapView.bounds.size,false, 0.0)
self.view.layer.renderInContext(UIGraphicsGetCurrentContext()!)
snapShot = UIGraphicsGetImageFromCurrentImageContext()
试试这个代码
UIGraphicsBeginImageContextWithOptions(self.AgsMapView.bounds.size,false, 0.0)
self.view.layer.renderInContext(UIGraphicsGetCurrentContext()!)
snapShot = UIGraphicsGetImageFromCurrentImageContext()
调用“renderContext”表示“self.AgsMapView.layer”,而不是“self.view.layer”。调用“renderContext”表示“self.AgsMapView.layer”,而不是“self.view.layer”。