【发布时间】:2016-09-06 11:19:02
【问题描述】:
如何更改tintColor 的button.imageView。如果我在UIImageView 中使用与下面相同的渲染模式,tintColor 会发生变化,但按钮的图像视图不会发生同样的情况。是因为 buttonType 吗?
UIButton *frontButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
[frontButton setImage:[[UIImage imageNamed:FRONT_IMAGE] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate] forState:UIControlStateNormal];
[frontButton.imageView setTintColor:[UIColor redColor]];
[self addSubview:frontButton];
【问题讨论】:
-
link希望此链接对您有所帮助。
标签: ios objective-c uiimageview uibutton