views:

38

answers:

3

I have ten labels on a view positioned vertically. I need to evenly space them. Does IB have any type of setting that will do this?

A: 

Do the math and then type in the X,Y coordinates. Unfortunately, I think that is the easiest way.

Jason
THis really is the easiest way (at least if you care about accuracy), it's very quick to simply select each element in turn and enter a new Y coordinate... you can easily drag to align the X coordinate first.
Kendall Helmstetter Gelner
+2  A: 

If you select individual labels and drag them around the view, they should "snap" to certain guides around the interface. If you drag an element close to another element it should snap to about 8 pixels away, and that's the standard spacing between elements on the iPhone.

If you want more precise control, you can select an element and use the arrow keys to move it around one pixel at a time.

You can also use the Align Horizontally/Vertically in Container menu items from the Layout menu.

Jasarien
Thanks. I see the horizontal line appear for 8 pixels. I'm doing this in a tableviewcell. It creates a fairly large cell with that much spacing. But if it is the standard, I'll stay with it. The top of the next cell peeps into view. Should I just make each cell consume the entire viewing area?
4thSpace
Alignment is very different from Distribution though, which is what it seemed like the poster was asking about... but since he marked your answer as correct perhaps you better understood what he was asking.
Kendall Helmstetter Gelner
When I said standard, I didn't mean that to sound like it had to be adhered to. Perhaps "default" would have sounded better? In any case, it depends on your interface design. If you have small space constraints then perhaps a smaller spacing between the elements will work better. Try 4 instead of 8?
Jasarien
A: 

If you are OK using Apple's guideline spacing, dragging one label near another will generate a dashed line at a certain point. Do this for each label below the next, and they will be evenly spaced.

David Kanarek