Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial

Mark Cranston
1,817 PointsNot having child alpha be influence by parent view
I have placed a button in a view and I want the view to be translucent, but the button to be solid. The button is taking on whatever alpha the the view has. How do I get the button to have it's own alpha?
Thanks in advance!

Mark Cranston
1,817 PointsI am changing the alpha in the storyboard attributes inspector.
1 Answer

Gabe Nadel
Treehouse Guest TeacherWell, the items in a view WILL be subject to the alpha of their parent view, that's the way it works, and for good reason. However, perhaps you can fake this out a bit:
Make your parent view fully opaque, alpha =1, but set it's background color to clear. Then, set your button however you want. If you want your view to appear translucent (but not completely transparent) then create a new UIView inside of the parent UIView (of the same size as the parent view) and give THAT UIView the alpha and background color you want users to see as "translucent".
Caleb Kleveter
Treehouse Moderator 37,862 PointsCaleb Kleveter
Treehouse Moderator 37,862 PointsHow are you changing the alpha of the view?