gpt4 book ai didi

ios - MKMapSnapshotter 渲染边框为白色

转载 作者:搜寻专家 更新时间:2023-11-01 07:30:30 29 4
gpt4 key购买 nike

我正在使用 MKMapSnapshotter 创建 map 的屏幕截图,然后将其显示在 UIImageView 中。

let imageView = UIImageView()
imageView.frame = view.bounds
view.addSubview(imageView)

let options = MKMapSnapshotOptions()
options.scale = UIScreen.mainScreen().scale
options.region = mapView.region
options.size = mapView.frame.size

let snapshotter = MKMapSnapshotter(options: options)
snapshotter.startWithCompletionHandler { (snapshot, error) -> Void in
imageView.image = snapshot?.image
}

但是,生成的图像似乎有难看的白线,而不是标准的细红色国家(和联邦)边界。

Simulator screenshot of image view

有什么方法可以使屏幕截图看起来像原始 map 吗?

Simulator screenshot of map view

最佳答案

这似乎是一个模拟器问题。我在模拟器上看到了同样的问题,但在真正的 iOS 8 和 iOS 9 设备上快照包含正确的国家边界。

关于ios - MKMapSnapshotter 渲染边框为白色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32710842/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com