有些時(shí)候設(shè)置button的取消點(diǎn)擊高亮效果設(shè)置屬性adjustsImageWhenDisabled和adjustsImageWhenHighlighted在實(shí)際應(yīng)用中效果沒(méi)實(shí)現(xiàn)
btn.adjustsImageWhenDisabled = NO;
btn.adjustsImageWhenHighlighted = NO;
這時(shí)候你可以采用下面的方法實(shí)現(xiàn)選中取消高亮效果
UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
[btn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside | UIControlEventAllTouchEvents];
- (void)btnClick:(UIButton *)btn {
btn.highlighted = NO;
}