iPhone mapview区域缩放无法正常工作

| 这是我的代码:
CLLocationCoordinate2D location;
location.latitude = 50;
location.longitude = -50;
MKCoordinateRegion region = MKCoordinateRegionMakeWithDistance(location, 5, 5);

region.center=location;
[mapView setShowsUserLocation:TRUE];
[mapView setDelegate:self];

[mapView setRegion:region animated:TRUE];
[mapView regionThatFits:region];
[self setView:mapView];
它将放大,但是放大得太远。 因此,如果我将其更改为:
    CLLocationCoordinate2D location;
location.latitude = 50;
location.longitude = -50;
MKCoordinateRegion region = MKCoordinateRegionMakeWithDistance(location, 200, 200);

region.center=location;
[mapView setShowsUserLocation:TRUE];
[mapView setDelegate:self];

[mapView setRegion:region animated:TRUE];
[mapView regionThatFits:region];
[self setView:mapView];
它将一直缩小。我有什么想念的吗?
已邀请:
这是因为它在执行时过早调用了该方法。我添加了一个viewWillLoad,它将在加载后被调用,然后一切正常。谢谢您的帮助。
MKCoordinateRegionMakeWithDistance
的第二个和第三个自变量的5到200之间的数字是否会使区域放大中间量?文档说这些参数是该区域中每个方向的距离。

要回复问题请先登录注册