【问题标题】:ios - MKMapView dont show Current Locationios - MKMapView 不显示当前位置
【发布时间】:2012-01-19 18:59:43
【问题描述】:

在 MKMapKit 的地图视图控件中,我正在显示用户的当前位置。一个蓝色圆圈显示为当前用户的位置。点击时,它会显示一个注释视图“当前位置”,但我想在调用中显示一些文本。如何更改文本文本?

【问题讨论】:

    标签: ios mapkit


    【解决方案1】:
    - (MKAnnotationView *)mapView:(MKMapView *)map viewForAnnotation:(id <MKAnnotation>)annotation{
        if ([annotation isKindOfClass:[MKUserLocation class]])
        {
            ((MKUserLocation *)annotation).title = @"My Current Location";
            return nil;  //return nil to use default blue dot view
        }
    .
    .
    .
    .
    .
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-11-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-12-25
      • 1970-01-01
      • 2015-01-11
      • 1970-01-01
      相关资源
      最近更新 更多