大佬教程收集整理的这篇文章主要介绍了xcode – 如何在MKMapView Swift中放大图钉,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
>确定敲击了哪个引脚
>将mapView置于攻丝针上
如果您在项目中正确启动了mapView(以视图作为其委托),则可以使用mapView(_:didSelectAnnotationView:)方法完成上述两点,如下所示:
func mapView(mapView: MKMapView,didSELEctAnnotationView view: MKAnnotationView) { // get the particular pin that was tapped let pinToZoomOn = view.Annotation // optionally you can set your own boundaries of the zoom let span = MKCoordinateSpanMake(0.5,0.5) // or use the current map zoom and just center the map // let span = mapView.region.span // Now move the map let region = MKCoordinateRegion(center: pinToZoomOn!.coordinate,span: span) mapView.setRegion(region,animated: truE) }
以上是大佬教程为你收集整理的xcode – 如何在MKMapView Swift中放大图钉全部内容,希望文章能够帮你解决xcode – 如何在MKMapView Swift中放大图钉所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。