Max
Max

Reputation: 2859

Make UIView and subviews translucent as one layer, not individually

When setting the alpha of a UIView (on iOS) it sets each subview to the same value, but composites them with that alpha on top of their respective superviews. So the subviews are blended with their superviews.

I don't want this to happen. I want the opacity to be applied to the UIView as a whole, not to each individual view. I want to achieve the same effect as, say, CSS3's opacity, or applying opacity to a group of layers in Photoshop, rather than to each layer individually.

The complexity however is that in this UIView is a UITableView and others that need to be interactive. And it's not viable to have the view that is supposed to be behind this view on top instead.

My question is: What's the best way to achieve this?

Thank you!
Alec

Upvotes: 1

Views: 2437

Answers (1)

Jake
Jake

Reputation: 3973

There's a 'Renders with group opacity' setting in Info.plist

Documentation here: http://developer.apple.com/library/ios/#documentation/general/Reference/InfoPlistKeyReference/Articles/iPhoneOSKeys.html

(Search for the mentioned setting).

Upvotes: 5

Related Questions