问题描述:

In iOS 4.0.2, I would like to set the alpha to 0.00 for each object on the view that I has a tag of 100.

 (id object in [self.view subviews])

{

if ([object tag] == 100)

{

//what goes here ...

}

}

网友答案:
[self.view viewWithTag:100].alpha = 0.0;

There's no need to set the alpha of all views. The alpha applies cumulatively to all subviews. So the whole tree starting at that view will become invisible.

Makes more sense to do this usually, rather than set the alpha to 0:

[self.view viewWithTag:100].hidden = YES;
相关阅读:
Top