StackLayoutGuide
open class StackLayoutGuide<Parent> : LayoutGuide<Parent>, AdjustableLayoutElement, AdaptiveLayoutElement where Parent : LayoutElementsContainer
StackLayoutGuide layout guide for arranging items in ordered list. It’s analogue UIStackView.
For configure layout parameters use property scheme
.
Attention: before addition items to stack, need add stack layout guide to super layout element using func add(layoutGuide:)
method.
-
StackLayoutScheme entity for configuring axis, distribution and other parameters.
Declaration
Swift
open lazy var scheme: StackLayoutScheme { get set }
-
The list of items arranged by the stack layout guide
Declaration
Swift
open var arrangedItems: [LayoutElement] { get }
-
Insets for distribution space
Declaration
Swift
open var contentInsets: EdgeInsets { get set }
-
Layout item where added this layout guide. For addition use
func add(layoutGuide:)
.Declaration
Swift
open override var ownerElement: Parent? { get set }
-
Performs layout for subitems, which this layout guide manages, in layout space rect
Declaration
Swift
override open func layout(in rect: CGRect)
Parameters
rect
Space for layout
-
Asks the layout item to calculate and return the size that best fits the specified size
Declaration
Swift
open func sizeThatFits(_ size: CGSize) -> CGSize
Parameters
size
The size for which the view should calculate its best-fitting size
Return Value
A new size that fits the receiver’s content
-
Undocumented
Declaration
Swift
override open var debugContentOfDescription: String { get }
-
Adds a layout guide to the end of the
arrangedItems
list.Declaration
Swift
public func addArrangedElement<T>(_ item: LayoutGuide<T>) where T : CALayer
Parameters
element
Layout guide for addition.
-
Inserts a element to arrangedItems list at specific index.
Declaration
Swift
public func insertArrangedElement<T>(_ item: LayoutGuide<T>, at index: Int) where T : CALayer
Parameters
element
Layout guide for addition
index
Index in list.
-
Removes from
arrangedItems
list and from hierarchy.Declaration
Swift
public func removeArrangedElement(_ item: LayoutElement)
Parameters
element
Layout guide for removing.
-
Adds a layout guide to the end of the
arrangedItems
list.Declaration
Swift
public func addArrangedElement(_ item: CALayer)
Parameters
element
CALayer for addition.
-
Inserts a element to arrangedItems list at specific index.
Declaration
Swift
public func insertArrangedElement(_ item: CALayer, at index: Int)
Parameters
element
Layer for addition
index
Index in list.
-
Removes from
arrangedItems
list and from hierarchy.Declaration
Swift
public func removeArrangedElement(_ item: CALayer)
Parameters
element
Layer for removing.
-
Adds a layout guide to the end of the
arrangedItems
list.Declaration
Swift
public func addArrangedElement<T>(_ element: LayoutGuide<T>) where T : NSView
Parameters
element
Layout guide for addition.
-
Inserts a element to arrangedItems list at specific index.
Declaration
Swift
public func insertArrangedElement<T>(_ element: LayoutGuide<T>, at index: Int) where T : NSView
Parameters
element
Layout guide for addition
index
Index in list.
-
Removes from
arrangedItems
list and from hierarchy.Declaration
Swift
public func removeArrangedElement<T>(_ element: LayoutGuide<T>) where T : NSView
Parameters
element
Layout guide for removing.
-
Adds a layout guide to the end of the
arrangedItems
list.Declaration
Swift
public func addArrangedElement<T>(_ element: LayoutGuide<T>) where T : CALayer
Parameters
element
Layout guide for addition.
-
Inserts a element to arrangedItems list at specific index.
Declaration
Swift
public func insertArrangedElement<T>(_ element: LayoutGuide<T>, at index: Int) where T : CALayer
Parameters
element
Layout guide for addition
index
Index in list.
-
Removes from
arrangedItems
list and from hierarchy.Declaration
Swift
public func removeArrangedElement<T>(_ element: LayoutGuide<T>) where T : CALayer
Parameters
element
Layout guide for removing.
-
Adds a layout guide to the end of the
arrangedItems
list.Declaration
Swift
public func addArrangedElement(_ element: NSView)
Parameters
element
View for addition.
-
Inserts a element to arrangedItems list at specific index.
Declaration
Swift
public func insertArrangedElement(_ element: NSView, at index: Int)
Parameters
element
View for addition
index
Index in list.
-
Removes from
arrangedItems
list and from hierarchy.Declaration
Swift
public func removeArrangedElement(_ element: NSView)
Parameters
element
View for removing.
-
Adds a layout guide to the end of the
arrangedItems
list.Declaration
Swift
public func addArrangedElement(_ element: CALayer)
Parameters
element
Layer for addition.
-
Inserts a element to arrangedItems list at specific index.
Declaration
Swift
public func insertArrangedElement(_ element: CALayer, at index: Int)
Parameters
element
Layer for addition
index
Index in list.
-
Removes from
arrangedItems
list and from hierarchy.Declaration
Swift
public func removeArrangedElement(_ element: CALayer)
Parameters
element
Layer for removing.