Modifiers
layoutPriority
Sets layout priority for the view.
layoutPriority(priority)
| Parameter | Type | Description |
|---|---|---|
priority | number | Layout priority value. |
Sets layout priority for the view.
Returns: ModifierConfig
See: Official SwiftUI documentation.
Works with
You can add layoutPriority to any view. It changes what you see on 6 of the 39 components.
No visible effect
These components accept it, but you see no change.
| Component | Why nothing happens |
|---|---|
| Group | It has an effect only when the view shares an axis with other views in a stack. |
| Divider | It has an effect only when the view shares an axis with other views in a stack. |
| Overlay | It has an effect only when the view shares an axis with other views in a stack. |
| ScrollView | It has an effect only when the view shares an axis with other views in a stack. |
| Button | It has an effect only when the view shares an axis with other views in a stack. |
| Toggle | It has an effect only when the view shares an axis with other views in a stack. |
| Checkbox | It has an effect only when the view shares an axis with other views in a stack. |
| Slider | It has an effect only when the view shares an axis with other views in a stack. |
| Picker | It has an effect only when the view shares an axis with other views in a stack. |
| DatePicker | It has an effect only when the view shares an axis with other views in a stack. |
| ColorPicker | It has an effect only when the view shares an axis with other views in a stack. |
| Link | It has an effect only when the view shares an axis with other views in a stack. |
| ControlGroup | It has an effect only when the view shares an axis with other views in a stack. |
| Menu | It has an effect only when the view shares an axis with other views in a stack. |
| ContextMenu | It has an effect only when the view shares an axis with other views in a stack. |
| TextField | It has an effect only when the view shares an axis with other views in a stack. |
| SecureField | It has an effect only when the view shares an axis with other views in a stack. |
| Text | It has an effect only when the view shares an axis with other views in a stack. |
| Label | It has an effect only when the view shares an axis with other views in a stack. |
| Image | It has an effect only when the view shares an axis with other views in a stack. |
| List | It has an effect only when the view shares an axis with other views in a stack. |
| Form | It has an effect only when the view shares an axis with other views in a stack. |
| Section | It has an effect only when the view shares an axis with other views in a stack. |
| DisclosureGroup | It has an effect only when the view shares an axis with other views in a stack. |
| SwipeActions | It has an effect only when the view shares an axis with other views in a stack. |
| BottomSheet | It has an effect only when the view shares an axis with other views in a stack. |
| Alert | It has an effect only when the view shares an axis with other views in a stack. |
| ConfirmationDialog | It has an effect only when the view shares an axis with other views in a stack. |
| Popover | It has an effect only when the view shares an axis with other views in a stack. |
| ProgressView | It has an effect only when the view shares an axis with other views in a stack. |
| Gauge | It has an effect only when the view shares an axis with other views in a stack. |
| TabView | It has an effect only when the view shares an axis with other views in a stack. |
| AccessoryWidgetBackground | It has an effect only when the view shares an axis with other views in a stack. |
Sources
The original Expo docs for this page:
- layoutPriority (Modifiers) (
source-of-truth/versions/v57.0.0/sdk/ui/swift-ui/modifiers.md)