第一种方法:
setAdjustsImageWhenHighlighted // default is YES. if YES, image is drawn darker when highlighted(pressed)
UIButton *priceBtn = [UIButton buttonWithType:UIButtonTypeCustom];
[priceBtn setTag:PRICE_BTN_TAG];
[priceBtn setFrame:CGRectMake(DISTANCE_OF_SCREEN_BORDER, 3, 63, 31.5)];
[priceBtn setBackgroundColor:[UIColor clearColor]];
[priceBtn setImage:[UIImage imageNamed:@"sequence_up_pressed.png"] forState:UIControlStateNormal];
[priceBtn addTarget:self action:@selector(priceBtnClicked:) forControlEvents:UIControlEventTouchUpInside];
[priceBtn setAdjustsImageWhenHighlighted:NO];
相关属性:
<