WeView 2

An alternative to iOS Auto Layout

Tutorial 6: Layout Properties

Margins and Spacing

Margins and spacing work like their HTML/CSS equivalents.


Don’t confuse Layout Alignment with Cell Alignment. Layout Alignment is a layout property and determines how a layout’s subviews as a whole are aligned within the WeView’s bounds. Cell Alignment is a subview property and determines how a subview is aligned within its layout cell. See the Layout Model section of the tutorial.


Layout Alignment and Subview Stretch apply when there is extra space in the WeView’s bounds for layout. There can also be a shortage of space. In this case Subview Stretch also applies. However, if the subviews cannot be stretched to fit inside a WeView, layouts can also optionally crop their subviews to fit inside their bounds. The cropSubviewOverflow layout property controls this behavior.

However, layouts generally should not have a shortage of space so you usually don’t need to worry about this.