簡體   English   中英

iOS MKMapViewDelegate-第二次獲取UserLocation

[英]iOS MKMapViewDelegate - Getting UserLocation the second time

我創建一個MKMapView並將MKMapViewDelegate與其關聯。

正確通知MKMapViewDelegate發生了DidUpdateUserLocation和其他生命周期事件。

當我稍后在應用程序中創建另一個MKMapView時,MKMapViewDelegate不會收到有關MapLoaded之類的任何通知。 只是構造函數被解雇了。

如何第二次獲取新的地圖實例,以使用生命周期事件更新MKMapViewDelegate?

在iPhone上使用.NET(MonoTouch)

在“地圖代表”僅一次處理此事件的情況下,它會被觸發很多。 這樣,您就不必擔心地圖如何緩存。

    public override void RegionChanged (MKMapView mapView, bool animated)
    {
        if (!hasSetupMapBoolean)
        {
            localCopymap = mapView;
            DoYourSetupMap ();
        }
    }

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM