2012-06-25 29 views
0

是否有可能在調用setRegion方法後知道何時mapView將完成繪製地圖?用setRegion繪製地圖區域後調用方法:animated:在iOS中

我計算區域參數之前顯示HUD

[SVProgressHUD showWithStatus:@"Finding"]; 

MKCoordinateRegion newRegion; 

newRegion.center.latitude  = (maxLat + minLat)/2; 
newRegion.center.longitude = (maxLon + minLon)/2; 
newRegion.span.latitudeDelta = maxLat - minLat; 
newRegion.span.longitudeDelta = maxLon - minLon; 

然後設定一個新的區域和隱藏HUD

[self.mapView setRegion:newRegion animated:NO]; 
[SVProgressHUD dismiss]; 

但HUD駁回比出現在地圖上的新區域更快。如何在繪圖之後解僱HUDsetRegion是否有任何回調?

回答

-1

[SVProgressHUD performSelector:@selector(dismiss)withObject:nil afterDelay:0.5]; 細節in the docs

0

– mapViewDidFinishLoadingMap: 可用於加載完地圖後執行代碼。