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

previewInterfaceOrientation(_:)

Overrides the orientation of the preview.

Declaration 宣言

func previewInterfaceOrientation(_ value: InterfaceOrientation) -> some View

Return Value 戻り値

A preview that uses the given orientation.

Parameters パラメータ

value

An orientation to use for preview.

Discussion 議論

By default, device previews appear right side up, using orientation portrait. You can change the orientation of a preview using one of the values in the InterfaceOrientation structure:


struct CircleImage_Previews: PreviewProvider {
    static var previews: some View {
        CircleImage()
            .previewInterfaceOrientation(.landscapeRight)
    }
}