Skip to main content

padding_set

Function padding_set 

Source
pub fn padding_set(
    view: &ViewHandle,
    edges: EdgeSet,
    length: Option<f64>,
) -> ViewHandle
Expand description

Apply .padding(_:_:) — chosen edges, an explicit length.

edges is an Edge.Set bit pattern: 1 top, 2 leading, 4 bottom, 8 trailing, so .vertical is 5 and .all is 15. A None length means the system’s own inset, as in padding_default. .padding(_:_:) with the edges named rather than spelled as a bitmask.

padding_edges takes the raw option-set bits, which a caller has to know; this reads the member out of SwiftUI’s own Edge.Set instead.