質問

- (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