ImageScale
A scale to apply to vector images relative to text.
Declaration
type ImageScale = 'large' | 'medium' | 'small';enum ScalePass a literal, or build one with SwiftUI.ImageScale from import { SwiftUI } from 'swiftui-react-native'.
Type properties
'large'SwiftUI.ImageScale.largeA scale that produces large images.
'medium'SwiftUI.ImageScale.mediumA scale that produces medium-sized images.
'small'SwiftUI.ImageScale.smallA scale that produces small images.
Overview
Use this type with the View.imageScale(_:) modifier, or the
EnvironmentValues.imageScale environment key, to set the image scale.
The following example shows the three Scale values as applied to
a system symbol image, each set against a text view:
HStack { Image(systemName: "swift").imageScale(.small); Text("Small") }
HStack { Image(systemName: "swift").imageScale(.medium); Text("Medium") }
HStack { Image(systemName: "swift").imageScale(.large); Text("Large") }From Apple’s SwiftUI documentation. Code samples there are Swift.
Used by
See also
More in Appearance.
- BackgroundProminenceThe prominence of backgrounds underneath other views.
- BadgeProminenceThe visual prominence of a badge.
- ButtonSizingThe sizing behavior of Buttons and other button-like controls.
- ColorA representation of a color that adapts to a given context.
- ColorRenderingModeThe set of possible working color spaces for color-compositing operations.
- ColorResolvedA concrete color value.
- ColorResolvedHDRA concrete color value, including HDR headroom information.
- ColorRGBColorSpaceA profile that specifies how to interpret a color value for display.
- ColorSchemeThe possible color schemes, corresponding to the light and dark appearances.
- GlassA structure that defines the configuration of a physical glass material.
- GlassChainGlass with chained calls: SwiftUI.Glass.interactive(...).
- ProminenceA type indicating the prominence of a view hierarchy.