實例方法
scale
scaleEffect(x:y:anchor:)
相對於錨點,按給定的水平和垂直量縮放此視圖的渲染輸出。
聲明
func scaleEffect(
x: CGFloat = 1.0,
y: CGFloat = 1.0,
anchor: UnitPoint = .center
) -> some View
參數
x
表示視圖縮放的水平量的量。默認值為
1.0
。y
表示視圖縮放的垂直量的量。默認值為
1.0
。anchor
指示縮放操作的起始位置的錨點。
詳述
使用 scaleEffect(x:y:anchor:)
以特定的水平和垂直量將縮放變換應用於視圖。
Image(systemName: "envelope.badge.fill")
.resizable()
.frame(width: 100, height: 100, alignment: .center)
.foregroundColor(Color.red)
.scaleEffect(x: 0.5, y: 0.5, anchor: .bottomTrailing)
.border(Color.gray)
可用版本
iOS 13.0+, iPadOS 13.0+, macOS 10.15+, Mac Catalyst 13.0+, tvOS 13.0+, watchOS 6.0+
相關用法
- Swift Optional scaleEffect(_:anchor:)用法及代碼示例
- Swift Optional scaledToFill()用法及代碼示例
- Swift Optional scaledToFit()用法及代碼示例
- Swift Optional scenePadding(_:)用法及代碼示例
- Swift Optional symbolVariant(_:)用法及代碼示例
- Swift Optional saturation(_:)用法及代碼示例
- Swift Optional submitLabel(_:)用法及代碼示例
- Swift Optional speechAlwaysIncludesPunctuation(_:)用法及代碼示例
- Swift Optional submitScope(_:)用法及代碼示例
- Swift Optional searchCompletion(_:)用法及代碼示例
- Swift Optional safeAreaInset(edge:alignment:spacing:content:)用法及代碼示例
- Swift Optional simultaneousGesture(_:including:)用法及代碼示例
- Swift Optional shadow(color:radius:x:y:)用法及代碼示例
- Swift Optional sheet(item:onDismiss:content:)用法及代碼示例
- Swift Optional swipeActions(edge:allowsFullSwipe:content:)用法及代碼示例
- Swift Optional sheet(isPresented:onDismiss:content:)用法及代碼示例
- 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(_:)用法及代碼示例
- Swift Optional clipShape(_:style:)用法及代碼示例
- Swift Optional preferredColorScheme(_:)用法及代碼示例
- Swift Optional background(_:ignoresSafeAreaEdges:)用法及代碼示例
注:本文由純淨天空篩選整理自apple.com大神的英文原創作品 Optional scaleEffect(x:y:anchor:)。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。