Skip to content

Instantly share code, notes, and snippets.

@neogithub
Created March 8, 2011 21:07
Show Gist options
  • Select an option

  • Save neogithub/861060 to your computer and use it in GitHub Desktop.

Select an option

Save neogithub/861060 to your computer and use it in GitHub Desktop.
loop through buttons and set highlight
-(IBAction)pushed:(id)sender
{
int btn = [sender tag];
UIButton *selBtn = (UIButton*)sender;
for (UIButton *view in [planImage subviews]) {
if ([view isKindOfClass:[UIButton class]]) {
[view setBackgroundImage:[UIImage imageNamed:@"WhiteBox.jpg"] forState:UIControlStateNormal];
view.alpha = 0.2;
}
}
[selBtn setBackgroundImage:[UIImage imageNamed:@"Icon.png"] forState:UIControlStateNormal];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment