【问题标题】:Custom pin with title subtitle iphone带有标题字幕 iphone 的自定义 pin
【发布时间】:2009-12-18 06:47:17
【问题描述】:

我有一个地图视图,我放了一个注释,显示了一个自定义标题和字幕图钉。 当地图视图启动时,图钉可见,但标题和副标题不可见。 我必须按下图钉才能显示标题和副标题。不按pin可以显示标题和副标题吗?

【问题讨论】:

    标签: iphone android-mapview


    【解决方案1】:

    这只是一个建议,但你可以试试

    [myCustomAnnotationView becomeFirstResponder];
    

    【讨论】:

    • - (MKAnnotationView *) mapView:(MKMapView *)mapView viewForAnnotation:(id ) annotation{ MKPinAnnotationView *newAnnotation = [[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:@"annotation1"]; newAnnotation.pinColor = MKPinAnnotationColorGreen; newAnnotation.animatesDrop=TRUE; newAnnotation.canShowCallout=YES; [newAnnotation 成为FirstResponder];返回新注解; } 我已经把它放在这里但它不起作用!
    【解决方案2】:

    你可以使用

      MKMapView *mapView;
      id<MKAnnotation> myAnnotation;
      // initialize mapView and myAnnotation...
      [mapView selectAnnotation:myAnnotation animated:YES]
    

    【讨论】:

    • 是的,我在很多应用程序中都使用过这个方法,你从哪里调用这个?
    【解决方案3】:

    http://www.iphonedevsdk.com/forum/iphone-sdk-development/19740-trigger-mkannotationview-callout-bubble.html#post110447

    无论如何,伙计们似乎是 xcode 特定版本的问题,请查看上面的链接。这是有效的

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-07-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-02-24
      • 2011-01-06
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多