centered
TypeScriptstatic get centered(): RealityViewLayoutOptionSwift declarationstatic let centered: RealityViewLayoutOptionThe option that centers the visual content within a flexible frame.
struct · iOS 26.0+ · SDK 27.1
struct RealityViewLayoutOptionOptions 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) } } ```
static get centered(): RealityViewLayoutOptionSwift declarationstatic let centered: RealityViewLayoutOptionThe option that centers the visual content within a flexible frame.
static get flexible(): RealityViewLayoutOptionSwift declarationstatic let flexible: RealityViewLayoutOptionThe 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).
static get fixedSize(): RealityViewLayoutOptionSwift declarationstatic let fixedSize: RealityViewLayoutOptionThe 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.
No declarations were skipped in this snapshot.