答案 0 :(得分:0)
如果我的问题正确无误,您可以添加点按手势以识别点击事件。无需在整个视图中添加轻触手势。为每个按钮添加操作并在操作方法中更改其背景颜色
答案 1 :(得分:0)
将以下代码添加到VC。
- (IBAction) didTapButton:(UIButton*) sender {
sender.backgroundColor = [UIColor redColor]; // or whatever
// create a IBOutletCollection called buttons with your buttons in it
for (UIButton *b in self.buttons) {
if (b != sender) {
b.backgroundColor = [UIColor blueColor]; // or whatever
}
}
}
将此操作设置为每个按钮的“内部触摸”。