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

rotationEffect(_:anchor:)

Rotates this view’s rendered output around the specified point. このビューのもつ描画された出力をこの指定された点を中心として回転します。

Declaration 宣言

func rotationEffect(_ angle: Angle, anchor: UnitPoint = .center) -> some View

Parameters パラメータ

angle

The angle at which to rotate the view. それでこのビューを回転する角度。

anchor

The location with a default of center that defines a point at which the rotation is anchored.

Discussion 議論

Use rotationEffect(_:anchor:) to rotate the view by a specific amount.

In the example below, the text is rotated by 22˚.


Text("Rotation by passing an angle in degrees")
    .rotationEffect(.degrees(22))
    .border(Color.gray)

A screenshot showing rotation effect rotating the text 22 degrees with