简体   繁体   English

NSTextfield的Backgroundcolor

[英]Backgroundcolor of NSTextfield

I use a NSTextfield as a label.我使用NSTextfield作为标签。 I try to change backgroundColor like this我尝试像这样更改backgroundColor

let myLabel = NSTextField(labelWithString: "A Label")
myLabel.backgroundColor = NSColor.green

But it does not work.但这是行不通的。 What´s going wrong?怎么了?

I use a NSTextfield as a label.我使用NSTextfield作为标签。 I try to change backgroundColor like this我尝试像这样更改backgroundColor

let myLabel = NSTextField(labelWithString: "A Label")
myLabel.backgroundColor = NSColor.green

But it does not work.但这是行不通的。 What´s going wrong?怎么了?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM