如何排序MKMapView上的註釋(MKAnnotation)?如何排序MKMapView上的註釋
0
A
回答
1
有關的MKMapView排序註釋我用didAddAnnotationViews回調:
- (void)mapView:(MKMapView *)mapView didAddAnnotationViews:(NSArray *)views {
for (MKAnnotationView * annView in views) {
if ([annView.annotations isTop]) {
[[annView superview] bringSubviewToFront:annView];
} else {
[[annView superview] sendSubviewToBack:annView];
}
}
}
1
嘗試這樣的事情,
NSArray *sortedArray = [mapView.annotations sortedArrayUsingComparator:<#^NSComparisonResult(id obj1, id obj2)cmptr#>];
基本上mapView.annotations會給你在你的NSArray所有註釋的訪問,然後使用sortedArray ...方法(there are lots of different one
),這將有助於您整理註釋數組並返回新的排序NSArry。
希望這是你在問什麼,
乾杯
相關問題
- 1. 如何重新排序的MKMapView註釋陣列
- 2. MKMapView,15k註釋
- 3. MKMapview註釋
- 4. iOS - MKMapView - Buggy註釋
- 5. 調整MkMapView註釋
- 6. 觸摸MKMapView上的註釋事件
- 7. 在放大的MKMapView上合併註釋
- 8. 導航到MKMapView上的註釋位置
- 9. 將MKMapView集中在註釋上
- 10. setUserTrackingMode在MKMapView上註釋很慢
- 11. MKMapView註釋更改/丟失順序?
- 12. 更改mkmapview(刪除註釋)
- 13. MKMapView不刷新註釋
- 14. MKMapView註釋點擊事件
- 15. MKMapView,預加載註釋
- 16. 如何在MKMapView上顯示自定義註釋?
- 17. 如何從MKMapView中除去用戶位置註釋以外的所有註釋?
- 18. 的MKMapView沒有顯示註釋的點
- 19. Java註釋反射排序
- 20. iOS MKMapView的自定義註釋
- 21. MKMapView遮擋剔除它的註釋嗎?
- 22. MKMapView中的兩個註釋引腳
- 23. 添加自定義註釋到的MKMapView
- 24. 的MKMapView addAnnotation不加註釋立即
- 25. 帶有註釋問題的MKMapView問題
- 26. 如何在MKMapView上添加Map註解?
- 27. 如何使MKMapView上的註釋與像蘋果一樣的地圖滾動?
- 28. 如何拖動MKMapView被拖動的註釋? (iOS)
- 29. 如何使用MKMapView中的彩色線連接2個註釋?
- 30. 如何讓我的MKMapView註釋顯示出來?
憑什麼你想這些註釋進行排序 –