0

I am trying to set the background color of an NSTextField like this

myTF.layer.layer.backgroundColor = [myColorWell color]

But I am getting an error

What is the beat way to get the color from a NSColorWell and set it to my NSTextField's backgroundColor?

I hope i have to conver the color i got from the NSColorWell and convert to either CGColorCreateGenericRGB or CGColorRef so that i can set the background

Can anybody please guide me?

4

1 回答 1

2

知道这很容易

myTF.layer.backgroundColor = [myColor CGColor];
于 2013-11-05T14:39:18.360 回答