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

stroke(_:lineWidth:)

Traces the outline of this shape with a color or gradient. この形状の輪郭をある色または勾配でなぞります。

Declaration 宣言

func stroke<S>(_ content: S, lineWidth: CGFloat = 1) -> some View where S : ShapeStyle

Return Value 戻り値

A stroked shape. 線をつけられた形状。

Parameters パラメータ

content

The color or gradient with which to stroke this shape. それでこの形状に線をつける色または勾配。

lineWidth

The width of the stroke that outlines this shape.

Discussion 議論

The following example draws a circle with a purple stroke:


Circle().stroke(Color.purple, lineWidth: 5)

See Also 参照

Setting the Stroke Characteristics 筆致特徴を設定する