![](/img/trans.png)
[英]How to show custom annotation even if it's on the user's current location with Swift
[英]How to select the user's location annotation in Swift
我試圖弄清楚在第一次向用戶顯示地圖時如何選擇用戶的默認位置注釋。 我知道我應該以某種方式使用此代碼:
mapView.selectAnnotation(theUsersLocationAnnotation, animated: true)
但是,“ theUsersLocationAnnotation”注釋到底從何而來,因為它通常是藍色的當前位置注釋。 我要如何訪問它才能在該注釋上稱呼它?
只需使用:
mapView.selectAnnotation(mapView.userLocation, animated: true)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.