---
title: "fixedLayout(width:height:)"
framework: developertoolssupport
role: symbol
role_heading: Type Method
path: "developertoolssupport/previewtrait/fixedlayout(width:height:)"
---

# fixedLayout(width:height:)

Center the preview in a fixed size container with the given dimensions.

## Declaration

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

## Discussion

Discussion This is the same as PreviewLayout.fixed(width:height:).

## See Also

### Getting a layout

- [defaultLayout](developertoolssupport/previewtrait/defaultlayout.md)
- [fixedLayout(width:height:depth:)](developertoolssupport/previewtrait/fixedlayout(width:height:depth:).md)
- [sizeThatFitsLayout](developertoolssupport/previewtrait/sizethatfitslayout.md)
