用户无法访问自定义地图标注视图

时间:2013-07-02 16:31:44

标签: ios map mapkit callout

我正在尝试自定义地图calloutview:

- (void)mapView:(MKMapView *)mapView didSelectAnnotationView:(MKAnnotationView *)view
{
    if ([view.annotation isKindOfClass:[MKUserLocation class]])
    {
        UIView * callout = [[NSBundle mainBundle] loadNibNamed:@"MyCallout" owner:nil options:nil][0];
        for (int i = 0; i < view.subviews.count; i++)
            [view.subviews[i] setHidden:YES];
        [view addSubview:callout];
        view.userInteractionEnabled = YES;
        return;
    }

    // ...
}

所以我的标注无法访问,按钮无法按下等...

0 个答案:

没有答案