Class: TouchBarLabel
Class: TouchBarLabel
Create a label in the touch bar for native macOS applications在触摸条中为本机macOS应用程序创建标签
Process:进程:Main
This class is not exported from the 此类不是从'electron'
module. 'electron'
模块导出的。It is only available as a return value of other methods in the Electron API.它只能作为Electron API中其他方法的返回值使用。
new TouchBarLabel(options)
When defining 在定义accessibilityLabel
, ensure you have considered macOS best practices.accessibilityLabel
时,请确保您考虑了macOS的最佳实践。
Instance Properties实例属性
The following properties are available on instances of TouchBarLabel
:TouchBarLabel
实例上提供了以下属性:
touchBarLabel.label
A 表示标签的当前文本的string
representing the label's current text. string
。Changing this value immediately updates the label in the touch bar.更改此值会立即更新触摸条中的标签。
touchBarLabel.accessibilityLabel
A 一个string
representing the description of the label to be read by a screen reader.string
,表示要由屏幕阅读器读取的标签的描述。
touchBarLabel.textColor
A 一个string
hex code representing the label's current text color. string
,表示标签当前文本颜色的十六进制代码。Changing this value immediately updates the label in the touch bar.更改此值会立即更新触摸条中的标签。