类:TouchBarLabel
类:TouchBarLabel
🌐 Class: TouchBarLabel
在触控栏为原生 macOS 应用创建标签
进程: 主进程
此类未从 'electron' 模块导出。它仅作为 Electron API 中其他方法的返回值提供。
new TouchBarLabel(options)
在定义 accessibilityLabel 时,确保你已经考虑了 macOS 的最佳实践。
🌐 When defining accessibilityLabel, ensure you have considered macOS best practices.
实例属性
🌐 Instance Properties
TouchBarLabel 实例上可用的属性如下:
🌐 The following properties are available on instances of TouchBarLabel:
touchBarLabel.label
string 表示标签当前的文本。更改此值会立即更新触控栏上的标签。
🌐 A string representing the label's current text. Changing this value immediately updates the label in
the touch bar.
touchBarLabel.accessibilityLabel
一个 string,表示屏幕阅读器要读取的标签的描述。
🌐 A string representing the description of the label to be read by a screen reader.
touchBarLabel.textColor
一个表示标签当前文本颜色的 string 十六进制代码。更改此值会立即更新触控栏上的标签。
🌐 A string hex code representing the label's current text color. Changing this value immediately updates the
label in the touch bar.