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

scaleEffect(_:anchor:)

Scales this view’s rendered output by the given amount in both the horizontal and vertical directions, relative to an anchor point. このビューのもつ描出された出力をこの与えられた量によって水平と垂直方向の両方で、あるアンカーポイントに関して、拡大縮小します。

Declaration 宣言

func scaleEffect(_ s: CGFloat, anchor: UnitPoint = .center) -> some View

Parameters パラメータ

s

The amount to scale the view in the view in both the horizontal and vertical directions.

anchor

The anchor point with a default of center that indicates the starting position for the scale operation.

Discussion 議論

Use scaleEffect(_:anchor:) to apply a horizontally and vertically scaling transform to a view.


Image(systemName: "envelope.badge.fill")
    .resizable()
    .frame(width: 100, height: 100, alignment: .center)
    .foregroundColor(Color.red)
    .scaleEffect(2, anchor: .leading)
    .border(Color.gray)

A screenshot showing a 100x100 pixel red envelope scaled up to 2x the