实现方法
- (void)start:(UIButton *)button
{
if(button.backgroundColor == [UIColor grayColor])
{
button.backgroundColor = [UIColor clearColor];
}else
{
button.backgroundColor = [UIColor grayColor];
}
UIButton *aButton = (UIButton *)[self.window viewWithTag:button.tag + 1];
UIButton *bButton = (UIButton *)[self.window viewWithTag:button.tag - 1];
UIButton *cButton = (UIButton *)[self.window viewWithTag:button.tag + 5];
UIButton *dButton = (UIButton *)[self.window viewWithTag:button.tag - 5];
if(aButton.backgroundColor == [UIColor grayColor])
{
aButton.backgroundColor = [UIColor clearColor];
}else
{
aButton.backgroundColor = [UIColor grayColor];
}
if(bButton.backgroundColor == [UIColor grayColor])
{
bButton.backgroundColor = [UIColor clearColor];
}else
{
bButton.backgroundColor = [UIColor grayColor];
}
if(cButton.backgroundColor == [UIColor grayColor])
{
cButton.backgroundColor = [UIColor clearColor];
}else
{
cButton.backgroundColor = [UIColor grayColor];
}
if(dButton.backgroundColor == [UIColor grayColor])
{
dButton.backgroundColor = [UIColor clearColor];
}else
{
dButton.backgroundColor = [UIColor grayColor];
}
}