Вопрос

- (IBAction)heapsOfButtons:(id)sender {
    UIButton *button = (UIButton *)sender;

    button.alpha = 0.25;

}

Let's say I use this action for ten buttons, now they're all with 0.25 alpha.

How do I change all of their alpha colour at once to 1?

Thanks.

Это было полезно?

Решение 2

First, set up all the buttons as a UICollectionView object -- you can do that in a Storyboard or programatically.

Second, use a method that's activated by some event to change the property of the entire UICollectionView.

Другие советы

You have outlet properties for each of your buttons, right? Do:

self.someButtonOutlet.alpha = 1.0;

where someButtonOutlet is replaced by an actual button property name. Repeat this for each property.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top