<!--
{
  "availability" : [
    "iOS: 17.0.0 -",
    "iPadOS: 17.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "DeveloperToolsSupport",
  "identifier" : "/documentation/DeveloperToolsSupport/PreviewTrait/fixedLayout(width:height:depth:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "DeveloperToolsSupport"
    ],
    "preciseIdentifier" : "s:21DeveloperToolsSupport12PreviewTraitVA2A0D0V10ViewTraitsORszlE11fixedLayout5width6height5depthACyAGG14CoreFoundation7CGFloatV_A2OtFZ"
  },
  "title" : "fixedLayout(width:height:depth:)"
}
-->

# fixedLayout(width:height:depth:)

Centers the preview in a fixed-size, 3D container.

```
@MainActor static func fixedLayout(width: CGFloat, height: CGFloat, depth: CGFloat) -> PreviewTrait<T>
```

## Discussion

This is the same as [`PreviewLayout.fixed3D(width:height:depth:)`](/documentation/DeveloperToolsSupport/PreviewLayout/fixed3D(width:height:depth:)).

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)