读书人

使用MKMapView控件缩小map时遇到有关问

发布时间: 2013-01-02 13:08:44 作者: rapoo

使用MKMapView控件缩小地图时遇到问题
我的代码

-(IBAction)zoomOut:(id)sender{
MKCoordinateRegion theRegion=mapView.region;
theRegion.span.longitudeDelta*=2.0;
theRegion.span.latitudeDelta*=2.0;
[mapView setRegion:theRegion animated:YES];
}


当缩小到最后一级时,程序就会自动退出.请问这是怎么回事
[解决办法]
theRegion.span.longitudeDelta*=2.0;
????theRegion.span.latitudeDelta*=2.0;

你这个每次都乘以2, 估计是缩小到最小后,这个span边界值超过 mkview里面允许的最大值了。

读书人网 >Iphone

热点推荐