ImageScale

A scale to apply to vector images relative to text.

EnumerationiOS 13.0+macOS 11.0+tvOS 13.0+watchOS 6.0+Image.Scale in SwiftUI

Declaration

React
type ImageScale = 'large' | 'medium' | 'small';
Swift
enum Scale

Pass a literal, or build one with SwiftUI.ImageScale from import { SwiftUI } from 'swiftui-react-native'.

Type properties

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.