类: TouchBarLabel
在原生macOS应用程序的触摸栏中创建一个标签
Process: Main
new TouchBarLabel(options)
实验功能
参数
对象label
String (可选) - 显示的文本.accessibilityLabel
String (optional) - A short description of the button for use by screenreaders like VoiceOver.textColor
String(可选) - 文本的十六进制颜色,例如#ABCDEF。
When defining accessibilityLabel
, ensure you have considered macOS best practices.
实例属性
以下属性可用于 TouchBarLabel
:
touchBarLabel.label
表示标签当前文本的字符串。 更改此值会立即更新触摸栏中的标签。
touchBarLabel.accessibilityLabel
A String
representing the description of the label to be read by a screen reader.
touchBarLabel.textColor
代表标签当前文字颜色的 字符串</ 0> 十六进制代码。 更改此值立即更新标签在触摸栏中。