UIButton
设置为以下代码:
UIButton *btn = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 27, 27)];
[btn setBackgroundImage:[UIImage imageNamed:@"imgUp.png"] forState:UIControlStateNormal];
[btn setBackgroundImage:[UIImage imageNamed:@"imgDown.png"] forState:UIControlStateHighlighted];
[btn addTarget:self action:@selector(btnPressed:) forControlEvents:UIControlEventTouchUpInside];
btw
如果我快速触摸,imgDown.png
则不会出现,但btnPressed:
会触发动作。怎么可能修好?任何帮助表示赞赏:)