我的每个 tableview 单元格中都有一个 UIButton。我想在点击动作发生时发光 uibutton。我使用代码将图像设置为其背景图像
UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
button.frame = CGRectMake(270,10,30,30);
[button setImage:[UIImage imageNamed:@"image.png"] forState:UIControlStateNormal];
[button addTarget:self action:@selector(action:) forControlEvents:UIControlEventTouchUpInside];
button.backgroundColor = [UIColor clearColor];
image.png 是有点暗的图像。因为我想通过显示发光的图像来显示点击效果。
现在我应该在单击发生时通过代码点亮 image.png 吗?或者我应该创建一个具有相同尺寸的新发光图像(比如 image_glow.png)并替换前一个?
无论如何,请解释如何实现这个......