Instance Method インスタンスメソッド

imageScale(_:)

Scales images within the view according to one of the relative sizes available including small, medium, and large images sizes. ビュー内部の画像それらの拡大縮小を、小、中、そして大の画像サイズを含む利用可能な相対的サイズの1つによって行います。

Declaration 宣言

func imageScale(_ scale: Image.Scale) -> some View

Parameters パラメータ

scale

One of the relative sizes provided by the image scale enumeration.

Discussion 議論

The example below shows the relative scaling effect. The system renders the image at a relative size based on the available space and configuration options of the image it is scaling.


VStack {
    HStack {
        Image(systemName: "heart.fill")
            .imageScale(.small)
        Text("Small")
    }
    HStack {
        Image(systemName: "heart.fill")
            .imageScale(.medium)
        Text("Medium")
    }


    HStack {
        Image(systemName: "heart.fill")
            .imageScale(.large)
        Text("Large")
    }
}

A view showing small, medium, and large hearts rendered at a size

See Also 参照

Scale 規準