實例方法
transform
transformEffect(_:)
對該視圖的渲染輸出應用仿射變換。
聲明
func transformEffect(_ transform: CGAffineTransform) -> some View
參數
transform
應用於視圖的
CGAffineTransform
詳述
使用 transformEffect(_:)
根據提供的
旋轉、縮放、平移或傾斜視圖的輸出。CGAffineTransform
在下麵的示例中,文本在 y
軸上旋轉 -30˚。
let transform = CGAffineTransform(rotationAngle: -30 * (.pi / 180))
Text("Projection effect using transforms")
.transformEffect(transform)
.border(Color.gray)
可用版本
iOS 13.0+, iPadOS 13.0+, macOS 10.15+, Mac Catalyst 13.0+, tvOS 13.0+, watchOS 6.0+
相關用法
- Swift Optional transaction(_:)用法及代碼示例
- Swift Optional truncationMode(_:)用法及代碼示例
- Swift Optional textSelection(_:)用法及代碼示例
- Swift Optional toolbar(id:content:)用法及代碼示例
- Swift Optional tint(_:)用法及代碼示例
- Swift Optional toolbar(content:)用法及代碼示例
- Swift Optional tabItem(_:)用法及代碼示例
- Swift Optional textContentType(_:)用法及代碼示例
- Swift Optional touchBarItemPresence(_:)用法及代碼示例
- Swift Optional touchBar(_:)用法及代碼示例
- Swift Optional task(priority:_:)用法及代碼示例
- Swift Optional touchBar(content:)用法及代碼示例
- Swift Optional toggleStyle(_:)用法及代碼示例
- Swift Optional textInputAutocapitalization(_:)用法及代碼示例
- Swift Optional touchBarCustomizationLabel(_:)用法及代碼示例
- Swift Optional tag(_:)用法及代碼示例
- Swift Optional task(id:priority:_:)用法及代碼示例
- Swift Optional touchBarItemPrincipal(_:)用法及代碼示例
- Swift Optional symbolVariant(_:)用法及代碼示例
- Swift Optional popover(isPresented:attachmentAnchor:arrowEdge:content:)用法及代碼示例
- Swift Optional mask(alignment:_:)用法及代碼示例
- Swift Optional listSectionSeparatorTint(_:edges:)用法及代碼示例
- Swift Optional badge(_:)用法及代碼示例
- Swift Optional fullScreenCover(isPresented:onDismiss:content:)用法及代碼示例
- Swift Optional keyboardType(_:)用法及代碼示例
注:本文由純淨天空篩選整理自apple.com大神的英文原創作品 Optional transformEffect(_:)。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。