Ios 当地图旋转或倾斜时禁用mkannotationview的旋转-swift

Ios 当地图旋转或倾斜时禁用mkannotationview的旋转-swift,ios,swift,mapkit,Ios,Swift,Mapkit,我有一个应用程序,有一个原始的汽车轴承,但当我倾斜或旋转地图,它如下,我不希望这种行为。我希望注释视图不会随着贴图倾斜或旋转 在谷歌地图中,您只需将其设置为false MKAnnotationView或MKPinAnnotationView中是否有相同的示例?您可以通过反转注释上的旋转角度来实现这一点: for annotation: MKAnnotation? in mapView.annotations { var annotationView: MKAnnotatio

我有一个应用程序,有一个原始的汽车轴承,但当我倾斜或旋转地图,它如下,我不希望这种行为。我希望注释视图不会随着贴图倾斜或旋转

在谷歌地图中,您只需将其设置为false


MKAnnotationView
MKPinAnnotationView
中是否有相同的示例?

您可以通过反转注释上的旋转角度来实现这一点:

    for annotation: MKAnnotation? in mapView.annotations {
       var annotationView: MKAnnotationView? = nil
       if let anAnnotation = annotation {
           annotationView = mapView.view(for: anAnnotation)
       }
       annotationView?.transform = CGAffineTransform(rotationAngle: -angle)
    }

可以通过反转注释上的旋转角度来实现这一点:

    for annotation: MKAnnotation? in mapView.annotations {
       var annotationView: MKAnnotationView? = nil
       if let anAnnotation = annotation {
           annotationView = mapView.view(for: anAnnotation)
       }
       annotationView?.transform = CGAffineTransform(rotationAngle: -angle)
    }

据我所知不是这样。我会用相同的框架覆盖一个透明的UIView,但也许有人知道更好的方法。@Grimxn谢谢你的指点。我希望有人有不同的解决方案。据我所知不是这样。我会用相同的框架覆盖一个透明的UIView,但也许有人知道更好的方法。@Grimxn谢谢你的指点。我希望有人有不同的解决方案。