我的 MKMapView 有问题。我添加这样的注释:
// set up new points
for(int i = 0; i < [_locations count]; i++) {
PPlace * place = [_locations objectAtIndex:i];
PlaceAnnotation * placeAnnotation = [[PlaceAnnotation alloc] initWithPlace:place];
// if annotation is for currently selected place
placeAnnotation.isCurrent = i == currentIndexPath.row;
[self.mapView addAnnotation:placeAnnotation];
if (placeAnnotation.isCurrent) {
[self.mapView selectAnnotation:placeAnnotation animated:YES];
}
[placeAnnotation release];
}
因此,我尝试在添加后立即显示标注 bouble,而不是在点击注释 pin 后。 在模拟器中一切正常,在装有 iOS 4.3.2 的 iPhone 3GS 上也是如此。但是,标注在运行 iOS 4.1 的 iPhone 4 上不会显示(仅在点击图钉后才会显示)。知道如何解决这个问题吗?
最佳答案
我的猜测是您没有为注释类的 title 属性赋值。即使您可以将 canShowCallout
设置为 YES
,除非标题中有内容,否则标注气泡不会显示。
关于iphone - MKMapView 标注在装有 iOS 4.1 的 iPhone 4 上不显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6340808/