Modifiers
gridColumnAlignment
Overrides the default horizontal alignment of the grid column that the view appears in.
gridColumnAlignment(alignment)
iOS 16+
| Parameter | Type | Description |
|---|---|---|
alignment(optional) | 'center' | 'leading' | 'trailing' | The HorizontalAlignment guide to use for the grid column that the view appears in. |
Overrides the default horizontal alignment of the grid column that the view appears in.
Returns: ModifierConfig
A view that uses the specified horizontal alignment, and that causes all cells in the same column of a grid to use the same alignment.
Works with
This modifier works with any view. These components accept it:
- VStack
- HStack
- ZStack
- LazyVStack
- LazyHStack
- Group
- Spacer
- Divider
- Overlay
- ScrollView
- Button
- Toggle
- Checkbox
- Slider
- Picker
- DatePicker
- ColorPicker
- Link
- ControlGroup
- Menu
- ContextMenu
- TextField
- SecureField
- Text
- Label
- Image
- List
- Form
- Section
- DisclosureGroup
- SwipeActions
- BottomSheet
- Alert
- ConfirmationDialog
- Popover
- ProgressView
- Gauge
- TabView
- AccessoryWidgetBackground
Sources
The original Expo docs for this page:
- gridColumnAlignment (Modifiers) (
source-of-truth/versions/v57.0.0/sdk/ui/swift-ui/modifiers.md)