Compose SwiftUIv0.4.0
esc
GuideAPIGitHub
View modifier

clipShape(_:)

Clips a view to a shape.

iOS 17.0+macOS 14.0+tvOS 17.0+watchOS 10.0+
fun Modifier.clipShape(shape: Shape, style: FillStyle = FillStyle()): Modifier

Overview

Image(systemName = SFSymbol.personFill, modifier = Modifier.frame(width = 48.0, height = 48.0).clipShape(Circle()))

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

nonisolated func clipShape<S>(_ shape: S, style: FillStyle = FillStyle()) -> some View where S : Shape

Topics

Overloads

fun Modifier.clipShape(shape: Shape, style: FillStyle = FillStyle()): Modifier
SwiftUI View.clipShape(_:style:)