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
Mike Lee
6,579 PointsUIView then adding another view
Hey guys, I created a view controller and added all of my objects ,like buttons,textfields,etc. Now I want to go back and add a UIImageView under all of that so I can make it a background image. How can I do this without delete all of my objects?
2 Answers
Emmanuel Masangcay
4,098 PointsGo ahead and add the UIImage view in your storyboard to your view controller. Resize accordingly and specify your background image in your attributes inspector. Right now, your background UIImage view is the top view and your buttons, textfields,etc are hidden behind it. This is because of the hierarchy of views. Since UIImage is the last view you added its on top.
In your storyboard, click on the "show document outline" button in the lower left corner of the storyboard screen.
Click the drop down on your ViewController and then click on "View". Click on your UIImage background view and drag it to the top of that drop down list. Now it is the first view in the hierarchy with the other views(buttons,textfields,etc.) on top of it.
I hope this helps.
Mike Lee
6,579 PointsWorked like a charm,Thank you very much .