如何在iOS7下自定义MKAnnotationView的calloutAccessoryView?

如何在iOS7下自定义MKAnnotationView的calloutAccessoryView?,ios7,uibutton,mkannotationview,uiappearance,Ios7,Uibutton,Mkannotationview,Uiappearance,在iOS6下,我执行了以下操作,为右callout附件视图的按钮设置自定义图像: UIButton*rightButton=[UIButton Button类型:UIButtonTypedTailButton]; [rightButton setImage:[UIImage ImageName:@“detailDispositionButton.png”]用于状态:UIControlStateNormal]; annotationView.rightCalloutAccessoryView=ri

在iOS6下,我执行了以下操作,为右callout附件视图的按钮设置自定义图像:

UIButton*rightButton=[UIButton Button类型:UIButtonTypedTailButton];
[rightButton setImage:[UIImage ImageName:@“detailDispositionButton.png”]用于状态:UIControlStateNormal];
annotationView.rightCalloutAccessoryView=rightButton;
这很有效。现在我正在将应用程序更新到iOS7,我只得到一个蓝色圆圈:

当我将图像替换为正方形图像时,它将变成正方形。但它也是蓝色的

似乎是
tintColor
。我试着把它设为零。我还尝试使用
buttonype:uibuttonypecustom
作为
buttonype
,但没有成功


有人对此有解决方案吗?

按钮类型
ui按钮类型默认为图像着色。改为使用
UIButtonTypeCustom

如果您确实需要
uiButtonTypedTailDisclosure
(而且我想不出您设置自定义图像的原因,您可以强制您的图像使用“始终原始”渲染模式:


[[UIImage ImageName:@“detaildispositionButton.png”]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]

谢谢,这就是解决方案!不过,我使用UIButtonTypeDetailDisposition,因为这里的帧设置正确。
imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal
帮助!