4

has somebody an idea why i can't force the mapView callout to use a detailDisclosureBtn instead of infoButton?

- (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>)annotation
{
    static NSString *identifier = @"HPIPAnnotation";

    if ([annotation isKindOfClass:[CoreCityAnnotation class]])
    {
        MKPinAnnotationView *annotationView = (MKPinAnnotationView *) [_mapView dequeueReusableAnnotationViewWithIdentifier:identifier];
        if (annotationView == nil) {
            annotationView = [[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:identifier];
        } else {
            annotationView.annotation = annotation;
        }

        UIButton *disclosureButton = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];

        annotationView.canShowCallout = YES;
        annotationView.animatesDrop = YES;

        annotationView.rightCalloutAccessoryView = disclosureButton;

    return annotationView;

    }

    return nil;
}

Thats my implementation of the delegate.

1 Answers1

5

The button images for detailDisclosure type and infoLight/infoDark are the same.

https://developer.apple.com/library/ios/documentation/userexperience/conceptual/mobilehig/Controls.html#//apple_ref/doc/uid/TP40006556-CH15-SW4

TAKeanice
  • 511
  • 3
  • 14
  • 1
    Yes, in the [iOS 7 UI Transition Guide](https://developer.apple.com/library/ios/documentation/userexperience/conceptual/TransitionGuide/Controls.html#//apple_ref/doc/uid/TP40013174-CH9-SW1), it says "In iOS 7, a Detail Disclosure button uses the same symbol as the Info button." I'm not sure what Apple's "logic" was here. –  Feb 25 '14 at 13:14
  • It was "detail" means the same as "information"... But you can easily make your own button. Images with the old look are all over the web. Or you did what i did once: run an app on iOS6 simulator, screenshot the button (in 2x and 1x size) and use that. – TAKeanice Feb 25 '14 at 14:07