iPhone Programming: Applying Alpha to Parent but not to Child Views
alpha, iphone, uiview
Solution
The parent that acts as your background should be changed to a sibling before the container that wraps your children. That way you can set the transparency without affecting the entire hierarchy.
This would look like this.
- `<item-container>`
- `<item-background>`
- `<children-container>`
- `<children/>`
This hierarchy, would have the same visibility order and let you set the opacity independently of the contents of the children container.
Problem
Is it possible to set Alpha to .75 or .50 (transparent) for Parent view but the Child views/controls are opaque (Alpha channel 1.0 - completely visible). Whenever i set Alpha of my main UIView to transparent, all the child views/controls are also shown as transparent. Is there any workaround?