Compose SwiftUIv0.4.0
esc
GuideAPIGitHub
View modifier

containerBackground(_:)

A view modifier that maps SwiftUI's containerBackground.

iOS 17.0+macOS 14.0+tvOS 17.0+watchOS 10.0+
fun Modifier.containerBackground(style: ShapeStyle, container: ContainerBackgroundPlacement): Modifier

Overview

Modifier.containerBackground(style = ShapeStyle.…, container = ContainerBackgroundPlacement.…)

This is the Kotlin form of SwiftUI View.containerBackground(_:for:): SwiftUI documentation. In Swift it reads:

nonisolated func containerBackground<S>(_ style: S, for container: ContainerBackgroundPlacement) -> some View where S : ShapeStyle

Topics

Overloads

fun Modifier.containerBackground(style: ShapeStyle, container: ContainerBackgroundPlacement): Modifier
SwiftUI View.containerBackground(_:for:)
fun Modifier.containerBackground(container: ContainerBackgroundPlacement, alignment: Alignment = Alignment.center, content: @Composable () -> Unit): Modifier
SwiftUI View.containerBackground(for:alignment:content:)