细节披露按钮颜色全球色彩

时间:2016-05-18 15:08:34

标签: ios swift mapkit

有没有办法让细节披露按钮呈现我的应用程序的红色全局色调?在屏幕截图中,您可以看到我的导航栏按钮项已采用全局色调。但是,当我向我的注释添加详细信息公开按钮时,它没有红色色调。下面是我添加详细信息披露按钮的代码。

      let rightButton = UIButton(type: .DetailDisclosure)
      rightButton.addTarget(self, action: #selector(MapViewController.showLocationDetails(_:)), forControlEvents: .TouchUpInside)
      annotationView.rightCalloutAccessoryView = rightButton

感谢您的任何建议!

MapView

1 个答案:

答案 0 :(得分:2)

不,你不能,你必须创建一个自定义信息披露按钮,并将其添加到视图中。

UIButton *myAccessoryButton = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 24, 24)];
[myAccessoryButton setBackgroundColor:[UIColor clearColor]];
[myAccessoryButton setImage:[UIImage imageNamed:@"my_red_accessory_image"] forState:UIControlStateNormal];
相关问题