gpt4 book ai didi

iphone - 在使用Mapkit时,我可以看到完全可滚动的 map ,但没有看到Apple总部?

转载 作者:行者123 更新时间:2023-11-29 05:06:51 24 4
gpt4 key购买 nike

我已经在实际设备(iPad)和 iPhone 模拟器(ios 4)上尝试过

即使放大,我也看到了 map ,但没有看到 Apple 总部(蓝色图钉)。

在我的 OnViewLoad 函数中,我有:

mapView = [[MKMapView alloc] initWithFrame:self.view.bounds];

mapView.showsUserLocation=TRUE;
mapView.mapType=MKMapTypeHybrid;

[self.view insertSubview:mapView atIndex:0];

最佳答案

在您的 -mapView:viewForAnnotation: 方法中,如果注释是 userLocation 对象,则返回 nil:

- (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>)annotation {
if ([annotation isMemberOfClass:[MKUserLocation class]]) {
return nil;
}
// your normal code
}

这需要确保 iOS 默认实现用于显示蓝色 userLocation 点。

关于iphone - 在使用Mapkit时,我可以看到完全可滚动的 map ,但没有看到Apple总部?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4671627/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com