Modifiers
tint
Sets the tint color of a view.
tint(color)
| Parameter | Type | Description |
|---|---|---|
color | Color | The tint color (hex string). For example, #FF0000. |
Sets the tint color of a view.
Returns: ModifierConfig
See: Official SwiftUI documentation.
Works with
You can add tint to any view. It changes what you see on 35 of the 39 components.
- VStack
- HStack
- ZStack
- LazyVStack
- LazyHStack
- Group
- Overlay
- ScrollView
- Button
- Toggle
- Checkbox
- Slider
- Picker
- DatePicker
- ColorPicker
- Link
- ControlGroup
- Menu
- ContextMenu
- TextField
- SecureField
- Label
- Image
- List
- Form
- Section
- DisclosureGroup
- SwipeActions
- BottomSheet
- Alert
- ConfirmationDialog
- Popover
- ProgressView
- Gauge
- TabView
No visible effect
These components accept it, but you see no change.
| Component | Why nothing happens |
|---|---|
| Spacer | It changes the accent colour of controls and SF Symbols, and Spacer shows neither. |
| Divider | Divider does not use the tint colour. |
| Text | It changes the accent colour of controls and SF Symbols, and Text shows neither. |
| AccessoryWidgetBackground | It changes the accent colour of controls and SF Symbols, and AccessoryWidgetBackground shows neither. |
Sources
The original Expo docs for this page:
- tint (Modifiers) (
source-of-truth/versions/v57.0.0/sdk/ui/swift-ui/modifiers.md)