 |
 |
Another simple problem...
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Apr 2001
Location: Murray, Utah, USA
Status:
Offline
|
|
Probably extremely simple, but I've tried I think every combination I can think of -- how do I link a view to the window, so that when the window is resized the view grows/shrinks as well?
I know it is done in IB with the Size info panel and the "springs" and straight lines... just can't figure it out.
For simplicity, if someone could just give an example (simple steps) of making a view that takes up the entire window "real estate" and grows with it that'd be great!
Thanks again, everyone! 
Jeff
|
|
|
| |
|
|
|
 |
|
 |
|
Dedicated MacNNer
Join Date: Apr 2001
Location: San Francisco, USA
Status:
Offline
|
|
Here is my understanding of how the size inspector works: straight lines indicate fixed values and springs represent values that can grow/shrink. Now think about what happens when you grow the window.
Code:
Coordinates of view
before resize:
(10,10)-----(20,10)
width=10 height=20
(10,30)-----(20,30)
after resize:
(10,10)------------(25,10)
width=15 height=25
(10,35)------------(25,35)
What values stay the same? The top and left coordinates. What values change? The width and height, and the bottom and right coordinates. Therefore to get this behavior in IB, you want straight lines for the top and left, springs for width and height (inside the box), and springs for the bottom and right.
Like this:
Code:
|
_|_
| 3 |
--|m+m|mm
|_3_|
3
3
I don't have access to IB at the moment, but I think this is correct. Please excuse my horrible ascii art. 
|
|
|
| |
|
|
|
 |
|
 |
|
Dedicated MacNNer
Join Date: Jan 2001
Location: Virginia, US
Status:
Offline
|
|
The interior springs indicate that the view itself will resize in that dimension if the window (well, superview really) resizes. The four settings on the outside indicate whether that edge of the view should "stick" to that side of the window when things are resized -- i.e. remain a constant distance from that window edge (or superview edge, if it's a subview of another one).
For a view that takes up the entire window, both interior settings should be springs, and the four outside settings should be struts (lines).
For a button in the bottom left that should remain in the bottom left, the interior settings should be struts (since the button itself should never resize), the bottom and left outside edges should be struts, and the top and right outside edges should be springs.
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|