Skip to main content

Spacer

Element type: Dictionary

Lets you space out your layout with a component. It will use all the available height if you do not specify the Height key. And if other spacers are present with no Height key in the same container, they will have the same height.

tip

This is useful when you want to center components vertically: just add a spacer at the first place and one at the end of the container component’s array, with no Height given.

Keys

NameTypePossible valuesRequired
TypeStringSpacerRequired
HeightNumber-
MarginsDictionary (Margins)-
BorderDictionary (Border)-
Condition PRODictionary (Condition)-

Detail

Type Required

Type: String
Explanation: The type of the component which has to be Spacer.

Height

Type: Number
Explanation: If specified, the spacer will have a fixed height in points. Otherwise, it will use all the available height. The available height is equally used by all Spacer components which do not have a fixed height.

Margins

Type: Dictionary (Margins)
Explanation: Add padding to the component's sides.

Border

Type: Dictionary (Border)
Explanation: Add a top or bottom border to a component.

Condition PRO

Type: Dictionary (Condition)
Explanation: Allows to hide or show the component using a boolean expression.

Example

Spacer with no fixed height.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<!-- ... -->
<key>Slides</key>
<array>
<dict>
<key>Containers</key>
<array>
<dict>
<key>Components</key>
<array>
<dict>
<key>Type</key>
<string>Spacer</string>
</dict>
</array>
</dict>
</array>
</dict>
</array>
<!-- ... -->
</dict>
</plist>

Spacer with fixed height.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<!-- ... -->
<key>Slides</key>
<array>
<dict>
<key>Containers</key>
<array>
<dict>
<key>Components</key>
<array>
<dict>
<key>Type</key>
<string>Spacer</string>
<key>Height</key>
<integer>15</integer>
</dict>
</array>
</dict>
</array>
</dict>
</array>
<!-- ... -->
</dict>
</plist>