Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

McBgnr

macrumors regular
Original poster
Apr 13, 2009
144
0
In my application, I thought of putting a background image towards the end of UI development. This window in which I wanted to put the background image had numerous controls with references. Although adding the image object to the window is simple, but what I was not able to achieve is to put the image behind my controls. Thus this window showed only the image at runtime. Then I had to redesign this window from the scratch. This resulted in loss of references, which had to be set again.

Was just wondering if there is some way of avoiding this rework...Pls suggest!
 

kainjow

Moderator emeritus
Jun 15, 2000
7,958
7
Why would you have to redesign from scratch? You could have copied the controls to a temporary view. Or if you had them in an existing view, select that view and drag it to your nib window, which would make a copy of the view with all the controls in tact. Yes some of the connections may break but that doesn't take long to setup again.

If your view/window is overly complicated, consider splitting it up into multiple views and combine them back together in code (or simplifying your UI). I do this often for split views and other views that aren't always visible in the main view/window.
 

WhiteRabbit

macrumors newbie
Jan 11, 2005
26
0
Interface Builder is equiped with a "Send to back" utility listed under the Layout menubar item.
 

McBgnr

macrumors regular
Original poster
Apr 13, 2009
144
0
Gr8... wasn't aware of the menu option... Now I can easily put the controls back and bring them forward.
 

kainjow

Moderator emeritus
Jun 15, 2000
7,958
7
Interface Builder is equiped with a "Send to back" utility listed under the Layout menubar item.

That actually doesn't really always work. Maybe in some instances, but if you're relying on it to keep the order it won't always work, at least that is what I've found.

The best way to maintain stacking order is to use subviews.
 

McBgnr

macrumors regular
Original poster
Apr 13, 2009
144
0
Thanks kainjow.

I have just tried it on a simple window with two overlapping controls... Will try using subviews as well, for making the order.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.