无法更改按钮图像的颜色

时间:2015-10-11 17:16:27

标签: ios objective-c button

当我写这段代码时:

self.button.imageView.image setTintColor:[UIColor colorWithRed:76/255.0 green:145/255.0 blue:65/255.0 alpha:1]];

我收到错误

  

没有可见的@interface用于' UIImage'声明选择器' setTintColor:'

但对于另一张图片,它有效!我该怎么办?

1 个答案:

答案 0 :(得分:1)

UIImage类没有tintColor属性。 您可以在UIImageView或UIButton上设置tintColor,但最终结果可能会因按钮的配置而异。

相关问题