One Logo Pool Ball
_RealityKit_SwiftUI · IOS API REFERENCE

RealityViewLayoutOption

struct · iOS 26.0+ · SDK 27.1

struct RealityViewLayoutOption

Options that specify the frame sizing and content alignment option for `RealityView`. Pass in a `RealityViewLayoutOption` when using the <doc://com.apple.documentation/documentation/swiftui/view/realityviewlayoutbehavior(_:)> modifier: ```swift struct ModelWrapperView: View { let modelName: String var body: some View { RealityView { content in let model = try? await Entity(named: modelName) if let model { content.add(model) } } .realityViewLayoutBehavior(.fixedSize) } } ```

Members (3)

get · iOS 26.0+

centered

TypeScript
static get centered(): RealityViewLayoutOption
Swift declaration
static let centered: RealityViewLayoutOption

The option that centers the visual content within a flexible frame.

get · iOS 26.0+

flexible

TypeScript
static get flexible(): RealityViewLayoutOption
Swift declaration
static let flexible: RealityViewLayoutOption

The option that applies the default layout behavior of `RealityView`, where the content is not centered and the frame is flexible (takes up as much space as the SwiftUI layout provides).

get · iOS 26.0+

fixedSize

TypeScript
static get fixedSize(): RealityViewLayoutOption
Swift declaration
static let fixedSize: RealityViewLayoutOption

The option that fixes the size of the frame to equal the size of the visual content and centers the content within the new frame size.

Skipped declarations

No declarations were skipped in this snapshot.

All _RealityKit_SwiftUI types →