我的问题只发生在iPad上。 MKMapView总是存在未渲染部分(下图右侧)。只要我触摸这个窗口,mapview重新绘制自己就好了。但它永远不会马上呈现正确。在iOS 4.2以及模拟器和设备中的iOS 3.2中发生此问题。该构造的MKMapView的代码是正确的下面:在iPad上MKMapView呈现问题
- (void)viewDidLoad {
[super viewDidLoad];
mapview = [[[MKMapView alloc] initWithFrame:CGRectMake(0,0,self.view.frame.size.width,230)] autorelease]; // because of apples bug
mapview.autoresizingMask = UIViewAutoresizingFlexibleWidth;
MKCoordinateSpan globe = MKCoordinateSpanMake(100, 100);
CLLocationCoordinate2D worldCenter; worldCenter.latitude = 42.032974; worldCenter.longitude =21.359375;
MKCoordinateRegion worldmap = MKCoordinateRegionMake(worldCenter, globe);
mapview.region = worldmap;
mapview.zoomEnabled = NO;
mapview.showsUserLocation = YES;
mapview.delegate = self;
NSRange theRange;
theRange.location = 1;
theRange.length = [annotations count]-1;
[mapview addAnnotations:[annotations subarrayWithRange:theRange]];
[self.view addSubview:mapview];
}
的问题表现只在横向方向。
UPDATE
这是怎么跨越后,我感动的看法。
貌似你试图中心与跨度过大的地图来填满整个屏幕的世界中心的地图?据我所见,在屏幕右侧没有地图“左”可供渲染 - 即这是世界末日:) - 因此,请尝试播放跨度值以查看它是否能解决您的问题。 – Rog 2011-02-25 23:07:34
@Rog只要我触摸这个视图,它就呈现得很好。它总是有足够的世界观,因为它通过削减地球的高度来自动缩放。 – bioffe 2011-02-25 23:14:34
当你触摸屏幕并重新渲染时,你在右侧看到了什么酷炫的东西?我只是试图在地图应用上进行最大缩小,右侧与上面张贴的内容相吻合,所以我很好奇!? – Rog 2011-02-25 23:27:32