Reputation: 5806
.previewLayout(.fixed(width: 480, height: 320)) has no effect in Xcode 13.4 and Xcode 14 beta 3
The preview is shown in portrait vs expected landscape
Upvotes: 3
Views: 500
Reputation: 3051
To make it clear here, you did not actually set your preview
in landscape mode. Two solutions for your problem:
Selectable
in the canvas window to preview in a fixed sized window. I have drawn a red line around that part in the attached image. (code and image are below)FContentView() //fixed size window
.previewLayout(.fixed(width: 480, height: 320))
.previewInterfaceOrientation(.landscapeLeft)
or right. You can choose either live / selectable. (code and image are below)FContentView() //real landscape view
.previewInterfaceOrientation(.landscapeLeft)
Upvotes: 1