0

Under iOS6 I did the following to set a custom image for the button of the right callout accessory view:

UIButton *rightButton = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];
[rightButton setImage:[UIImage imageNamed:@"detaildisclosurebutton.png"] forState:UIControlStateNormal];
annotationView.rightCalloutAccessoryView = rightButton;

That worked very well. Now I am updating the App to iOS7 and I just get a blue circle: Example

When I replace the image with a square image, it becomes a square. But it is blue too.

Seems to be the tintColor. I tried to set it to nil. I also tried to use buttonWithType:UIButtonTypeCustom as buttonType, but no success.

Has anyone a solution for it?

MMore
  • 375
  • 3
  • 12

1 Answers1

1

Button type UIButtonTypeDetailDisclosure tints the image by default. Use UIButtonTypeCustom instead.

If you really need UIButtonTypeDetailDisclosure (and I can't think of a reason why you would given that you're setting a custom image, you can force your image to use "always original" rendering mode:

[[UIImage imageNamed:@"detaildisclosurebutton.png"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]

Timothy Moose
  • 9,895
  • 3
  • 33
  • 44
  • Thanks, that's the solution! Nevertheless I am using UIButtonTypeDetailDisclosure, because of the correct frame setting here. `imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal` helped! – MMore Apr 22 '14 at 21:23