實例方法
clipped(antialiased:)
將此視圖剪輯到其邊界矩形框架。
聲明
func clipped(antialiased: Bool = false) -> some View
返回值
將此視圖剪輯到其邊界框的視圖。
參數
antialiased
一個布爾值,指示渲染係統是否對剪切矩形的邊應用平滑。
詳述
使用 clipped(antialiased:)
修飾符隱藏超出形狀布局邊界的任何內容。
默認情況下,視圖的邊框僅用於布局,因此任何超出邊框邊的內容仍然可見。
Text("This long text string is clipped")
.fixedSize()
.frame(width: 175, height: 100)
.clipped()
.border(Color.gray)
可用版本
iOS 13.0+, iPadOS 13.0+, macOS 10.15+, Mac Catalyst 13.0+, tvOS 13.0+, watchOS 6.0+
相關用法
- Swift Never clipShape(_:style:)用法及代碼示例
- Swift Never colorMultiply(_:)用法及代碼示例
- Swift Never confirmationDialog(_:isPresented:titleVisibility:actions:)用法及代碼示例
- Swift Never compositingGroup()用法及代碼示例
- Swift Never contextMenu(menuItems:)用法及代碼示例
- Swift Never cornerRadius(_:antialiased:)用法及代碼示例
- Swift Never colorInvert()用法及代碼示例
- Swift Never contentShape(_:_:eoFill:)用法及代碼示例
- Swift Never coordinateSpace(name:)用法及代碼示例
- Swift Never contrast(_:)用法及代碼示例
- Swift Never controlSize(_:)用法及代碼示例
- Swift Never confirmationDialog(_:isPresented:titleVisibility:actions:message:)用法及代碼示例
- Swift Never confirmationDialog(_:isPresented:titleVisibility:presenting:actions:message:)用法及代碼示例
- Swift Never containerShape(_:)用法及代碼示例
- Swift Never confirmationDialog(_:isPresented:titleVisibility:presenting:actions:)用法及代碼示例
- Swift Never pageCommand(value:in:step:)用法及代碼示例
- Swift Never opacity(_:)用法及代碼示例
- Swift Never accessibilityAction(action:label:)用法及代碼示例
- Swift Never alert(isPresented:error:actions:message:)用法及代碼示例
- Swift Never flipsForRightToLeftLayoutDirection(_:)用法及代碼示例
- Swift Never position(x:y:)用法及代碼示例
- Swift Never position(_:)用法及代碼示例
- Swift Never luminanceToAlpha()用法及代碼示例
- Swift Never accessibilityAction(_:_:)用法及代碼示例
- Swift Never previewDisplayName(_:)用法及代碼示例
注:本文由純淨天空篩選整理自apple.com大神的英文原創作品 Never clipped(antialiased:)。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。