嗨,我在Sketch 3中创建了一个自定义注释,当我将其缩小以适应地图视图时,它变得模糊。我该如何解决这个问题?
我也有这个问题。也许这可能会帮助其他人,因为你似乎已经找到了一个合适的解决方案。
func mapView(mapView: MKMapView, viewForAnnotation annotation: MKAnnotation) -> MKAnnotationView? {
let reuseId = "id"
var anView = mapView.dequeueReusableAnnotationViewWithIdentifier(reuseId)
if anView == nil {
anView = MKAnnotationView(annotation: annotation, reuseIdentifier: reuseId)
anView!.canShowCallout = true
}
else {
anView!.annotation = annotation
}
anView!.image = yourFullSizeImage
anView!.frame.size = CGSize(width: 50, height: 50) //Resize frame AFTER setting image, for me resizing frame first did not work
return anView
}
你可以尝试将你的Node纹理的过滤模式设置为.Nearest
let nodeTexture = SKTexture(imageNamed: "node")
nodeTexture.filteringMode = .Nearest
node = SKSpriteNode(texture: nodeTexture)