一、按钮有Normal 与 Select 状态
[UIButton buttonWithType:UIButtonTypeSystem]
1、设置setBackgroundImage
[self setBackgroundImage:[UIImage imageNamed:image] forState:state];
2、设置tintColor
self.audioButton.tintColor = [UIColor clearColor];
当不需要使用按钮的select状态时,只需要这样即可
二、按钮只有Normal状态,只需要一步操作即可以使用系统按钮
[self.audioButton setImage:[[UIImage imageNamed:@"icon_voice_chat"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] forState:UIControlStateNormal];
网友评论