我已将注释图钉更改为自定义图片,效果很好。但是,当图像在地图视图中掉落时,其边缘看起来有些粗糙。有谁知道如何锐化图像?
谢谢。
我有同样的问题,并通过使用UIGraphicsImageRenderer创建图像来解决。现在它们很锋利。
let whiteImage = UIImage(named: "white")
let size = CGSize(width: 60, height: 60)
let myImage = UIGraphicsImageRenderer(size: size).image { imageContext in
let context = imageContext.cgContext
whiteImage?.draw(in: CGRect(origin: .zero, size: CGSize(width: 70, height: 90)))
}
annotationView!.image = myImage