简体   繁体   中英

Making detail button always visible in iOS MapView

I have a map view on my iOS app and i want to make detail button that when user press the pin icon visible without interaction. It should be visible when user open the map. Is it possible to make it? I use the code for showing annotation, I need it for button.

标注图片

self.mapView.showAnnotations([destinationAnnotation], animated: true )

Yes it is possible to show annotation once you load map. You can simply make annotation is "selected". While this is generally achieved by a user tapping on the annotation view (ie the pin), you can also programmatically "select" the annotation:

mapView.selectAnnotation(annotation, animated: true)

When you add pin.

您可以尝试以编程方式选择 mapView annoattion:

mapView.selectAnnotation(annotation, animated:false)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM