我的MKMapView
有點問題。iPhone Objective C MKMapView在第一次打開時不放大
如果我打開它,它應該中心的引腳(可以只有一個引腳)和縮放到此引腳。 工作總是非常好,但是當我第一次打開地圖時,它只會將引腳居中,但會縮小到最大。
這是我的代碼:
- (void) viewDidAppear:(BOOL)animated
{
if(self.curPin != nil){
[self.map setCenterCoordinate: self.curPin.coordinate];
}
else{
[self.map setCenterCoordinate:locationManager.location.coordinate];
}
}
curPin是CLLocation
,在那裏我救我的腳的座標。
希望任何人都可以幫助我。
謝謝,弗朗茲
請變焦[這](http://troybrant.net/blog/2010/01/set-the-zoom-level-of- an-mkmapview /)教程 – swiftBoy