實例方法
projection
projectionEffect(_:)
將投影變換應用於此視圖的渲染輸出。
聲明
func projectionEffect(_ transform: ProjectionTransform) -> some View
參數
transform
應用於視圖的
ProjectionTransform
。
詳述
使用 projectionEffect(_:)
將 3D 變換應用於視圖。
下麵的示例將文本圍繞 z
軸旋轉 30˚,該軸是指向屏幕外的軸:
// This transform represents a 30˚ rotation around the z axis.
let transform = CATransform3DMakeRotation(
-30 * (.pi / 180), 0.0, 0.0, 1.0)
Text("Projection effects using transforms")
.projectionEffect(.init(transform))
.border(Color.gray)
可用版本
iOS 13.0+, iPadOS 13.0+, macOS 10.15+, Mac Catalyst 13.0+, tvOS 13.0+, watchOS 6.0+
相關用法
- Swift Never progressViewStyle(_:)用法及代碼示例
- Swift Never previewDisplayName(_:)用法及代碼示例
- Swift Never previewLayout(_:)用法及代碼示例
- Swift Never previewDevice(_:)用法及代碼示例
- Swift Never preferredColorScheme(_:)用法及代碼示例
- Swift Never prefersDefaultFocus(_:in:)用法及代碼示例
- Swift Never privacySensitive(_:)用法及代碼示例
- Swift Never previewInterfaceOrientation(_:)用法及代碼示例
- Swift Never pageCommand(value:in:step:)用法及代碼示例
- Swift Never position(x:y:)用法及代碼示例
- Swift Never position(_:)用法及代碼示例
- Swift Never popover(isPresented:attachmentAnchor:arrowEdge:content:)用法及代碼示例
- Swift Never padding(_:_:)用法及代碼示例
- Swift Never popover(item:attachmentAnchor:arrowEdge:content:)用法及代碼示例
- Swift Never padding(_:)用法及代碼示例
- Swift Never opacity(_:)用法及代碼示例
- Swift Never colorMultiply(_:)用法及代碼示例
- Swift Never accessibilityAction(action:label:)用法及代碼示例
- Swift Never alert(isPresented:error:actions:message:)用法及代碼示例
- Swift Never confirmationDialog(_:isPresented:titleVisibility:actions:)用法及代碼示例
- Swift Never flipsForRightToLeftLayoutDirection(_:)用法及代碼示例
- Swift Never luminanceToAlpha()用法及代碼示例
- Swift Never accessibilityAction(_:_:)用法及代碼示例
- Swift Never badge(_:)用法及代碼示例
- Swift Never buttonStyle(_:)用法及代碼示例
注:本文由純淨天空篩選整理自apple.com大神的英文原創作品 Never projectionEffect(_:)。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。