實例方法
label
labelStyle(_:)
設置此視圖中標簽的樣式。
聲明
func labelStyle<S>(_ style: S) -> some View where S : LabelStyle
詳述
使用此修飾符為視圖中的所有標簽設置特定樣式:
VStack {
Label("Fire", systemImage: "flame.fill")
Label("Lightning", systemImage: "bolt.fill")
}
.labelStyle(MyCustomLabelStyle())
可用版本
iOS 14.0+, iPadOS 14.0+, macOS 11.0+, Mac Catalyst 14.0+, tvOS 14.0+, watchOS 7.0+
相關用法
- Swift Never labelsHidden()用法及代碼示例
- Swift Never layoutPriority(_:)用法及代碼示例
- Swift Never luminanceToAlpha()用法及代碼示例
- Swift Never listRowSeparatorTint(_:edges:)用法及代碼示例
- Swift Never listSectionSeparatorTint(_:edges:)用法及代碼示例
- Swift Never listRowSeparator(_:edges:)用法及代碼示例
- Swift Never lineSpacing(_:)用法及代碼示例
- Swift Never listRowInsets(_:)用法及代碼示例
- Swift Never lineLimit(_:)用法及代碼示例
- Swift Never listSectionSeparator(_:edges:)用法及代碼示例
- Swift Never listRowBackground(_:)用法及代碼示例
- Swift Never pageCommand(value:in:step:)用法及代碼示例
- 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 position(x:y:)用法及代碼示例
- Swift Never position(_:)用法及代碼示例
- Swift Never accessibilityAction(_:_:)用法及代碼示例
- Swift Never previewDisplayName(_:)用法及代碼示例
- Swift Never badge(_:)用法及代碼示例
- Swift Never progressViewStyle(_:)用法及代碼示例
- Swift Never buttonStyle(_:)用法及代碼示例
注:本文由純淨天空篩選整理自apple.com大神的英文原創作品 Never labelStyle(_:)。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。