UIButton 选中状态下 高亮显示

Normal 状态下高亮UIControlStateHighlighted

Selected 状态下高亮 UIControlStateSelected | UIControlStateHighlighted

+(void)setToggleBtn:(UIButton *)Btn

{

[Btn setImage:[UIImage imageNamed:@"power_off"] forState:UIControlStateNormal];

[Btn setImage:[UIImage imageNamed:@"power_on"] forState:UIControlStateSelected];

[Btn setImage:[UIImage imageNamed:@"power_press"] forState:UIControlStateHighlighted];

[Btn setImage:[UIImage imageNamed:@"power_press"] forState:UIControlStateSelected | UIControlStateHighlighted];

}

####推荐一个linux命令行网站:https://rootopen.com

你可能感兴趣的:(UIButton 选中状态下 高亮显示)