需要构造一个全局变量self.priceBtn
在九宫格写法中
if (i==numTotal-1) {
self.priceBtn = btn;
self.priceBtn.selected = YES;
}
在button的点击方法中
-(void)clickTheFilterBtn:(UIButton *)btn{
btn.selected = !btn.selected;
if (btn!=self.priceBtn) {
self.priceBtn.selected = NO;
self.priceBtn = btn;
}
self.priceBtn.selected = YES;
}