實例方法
touch
touchBarCustomizationLabel(_:)
設置標識視圖函數的user-visible 字符串。
聲明
func touchBarCustomizationLabel(_ label: Text) -> some View
返回值
帶有一組自定義標簽的 Touch Bar 元素。
參數
label
包含自定義標簽的
Text
視圖。
詳述
此字符串在用戶自定義期間可見。
TextField("TouchBar Demo", text: $placeholder)
.frame(maxWidth: .infinity, maxHeight: .infinity)
.focusable()
.touchBar {
Button("♥️", action: selectHearts)
.touchBarCustomizationLabel(Text("Hearts"))
Button("♣️", action: selectClubs)
.touchBarCustomizationLabel(Text("Clubs"))
Button("♠️", action: selectSpades)
.touchBarCustomizationLabel(Text("Spades"))
Button("♦️", action: selectDiamonds)
.touchBarCustomizationLabel(Text("Diamonds"))
}
可用版本
macOS 10.15+
相關用法
- Swift Optional touchBarItemPresence(_:)用法及代碼示例
- Swift Optional touchBar(_:)用法及代碼示例
- Swift Optional touchBar(content:)用法及代碼示例
- Swift Optional touchBarItemPrincipal(_:)用法及代碼示例
- Swift Optional toolbar(id:content:)用法及代碼示例
- Swift Optional toolbar(content:)用法及代碼示例
- Swift Optional toggleStyle(_:)用法及代碼示例
- Swift Optional textSelection(_:)用法及代碼示例
- Swift Optional tint(_:)用法及代碼示例
- Swift Optional tabItem(_:)用法及代碼示例
- Swift Optional textContentType(_:)用法及代碼示例
- Swift Optional task(priority:_:)用法及代碼示例
- Swift Optional transaction(_:)用法及代碼示例
- Swift Optional textInputAutocapitalization(_:)用法及代碼示例
- Swift Optional truncationMode(_:)用法及代碼示例
- Swift Optional tag(_:)用法及代碼示例
- Swift Optional transformEffect(_:)用法及代碼示例
- Swift Optional task(id:priority:_:)用法及代碼示例
- 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 touchBarCustomizationLabel(_:)。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。