首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > Iphone >

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

2013-01-02 
使用MKMapView控件缩小地图时遇到问题我的代码-(IBAction)zoomOut:(id)sender{MKCoordinateRegion theRegi

使用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里面允许的最大值了。

热点排行