Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/file/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Macos 如何将渐变背景色设置为NSButton?_Macos_Gradient_Background Color_Nsbutton - Fatal编程技术网

Macos 如何将渐变背景色设置为NSButton?

Macos 如何将渐变背景色设置为NSButton?,macos,gradient,background-color,nsbutton,Macos,Gradient,Background Color,Nsbutton,我想将我的NSButton(不是UIButton)背景色设置为渐变色,如下图所示。我为NSbuttoncell添加了背景色,但是如何添加渐变色呢 使用 - (instancetype)initWithStartingColor:(NSColor *)startingColor endingColor:(NSColor *)endingColor

我想将我的NSButton(不是UIButton)背景色设置为渐变色,如下图所示。我为NSbuttoncell添加了背景色,但是如何添加渐变色呢

使用

- (instancetype)initWithStartingColor:(NSColor *)startingColor
                          endingColor:(NSColor *)endingColor