clipped(antialiased:)
Clips this view to its bounding rectangular frame.
Declaration
nonisolated func clipped(antialiased: Bool = false) -> some View
Parameters
- antialiased:
A Boolean value that indicates whether the rendering system applies smoothing to the edges of the clipping rectangle.
Mentioned in
Return Value
A view that clips this view to its bounding frame.
Discussion
Use the clipped(antialiased:) modifier to hide any content that extends beyond the layout bounds of the shape.
By default, a view’s bounding frame is used only for layout, so any content that extends beyond the edges of the frame is still visible.
Text("This long text string is clipped")
.fixedSize()
.frame(width: 175, height: 100)
.clipped()
.border(Color.gray)[Image]