Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/116.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/sql-server/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何为ios拍摄AGSMapView的快照?_Ios_Swift - Fatal编程技术网

如何为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”。