1.声明一个UIButton类型的变量
@property (nonatomic , strong) UIButton *lastButton;
2. 在button的监听事件里添加以下代码
if (!button.isSelected) {
self.lastButton.selected = !self.lastButton.selected;
button.selected = !button.selected;
self.lastButton = button;
}
网友评论