minimumScaleFactor
Sets the minimum amount that text in this view scales down to fit in the available space.
minimumScaleFactor(factor)
| Parameter | Type | Description |
|---|---|---|
factor | number | A fraction between 0 and 1 (including 0 and 1) that specifies the amount of text to draw. For example, a value of 0.5 draws the text in a font size as small as half the actual font if needed. |
Sets the minimum amount that text in this view scales down to fit in the available space.
Use this modifier if the text you place in a view doesn't fit and it's okay if the text shrinks to accommodate. For example, a label with a minimum scale factor of 0.5 draws its text in a font size as small as half of the actual font if needed.
Returns: ModifierConfig
See: Official SwiftUI documentation.
Works with
You can add minimumScaleFactor to any view. It changes what you see on 34 of the 39 components.
- VStack
- HStack
- ZStack
- LazyVStack
- LazyHStack
- Group
- Overlay
- ScrollView
- Button
- Toggle
- Checkbox
- Picker
- DatePicker
- ColorPicker
- Link
- ControlGroup
- Menu
- ContextMenu
- TextField
- SecureField
- Text
- Label
- 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 only text, and Spacer shows no text. |
| Divider | It changes only text, and Divider shows no text. |
| Slider | It changes only text, and Slider shows no text. |
| Image | It changes only text, and Image shows no text. |
| AccessoryWidgetBackground | It changes only text, and AccessoryWidgetBackground shows no text. |
Sources
The original Expo docs for this page:
- minimumScaleFactor (Modifiers) (
source-of-truth/versions/v57.0.0/sdk/ui/swift-ui/modifiers.md)
menuOrder
Sets the preferred order of items for menus presented from this view. With the default automatic order, a menu that opens upward displays its items in reverse. Pass fixed to always keep the order the items were provided in.
monospacedDigit
Modifies the fonts of all child views to use fixed-width digits, if possible, while leaving other characters proportionally spaced. When applied to Text, modifies the text view's font to use fixed-width digits, while leaving other characters proportionally spaced.