NSProgressIndicator的setControlTint无效

时间:2011-10-11 00:46:02

标签: colors nsprogressindicator

我有一个非常简单的任务:当用户暂停进度时,将NSProgressIndicator的颜色更改为石墨,这是一个确定的进度条。我找到了方法setControlTint,但在使用它之后就没有效果了。我也搜索了很多没有太多明确的答案。子类NSProgressIndicator是否必须做一些自定义绘图?我只是想知道为什么这个方法没有进一步的文件或关于正确使用的讨论。

非常感谢您的帮助:)

1 个答案:

答案 0 :(得分:-2)

见doc:

NSProgressIndicator的Doc 的 setControlTint:

设置接收者的控制色调。

- (void)setControlTint:(NSControlTint)controlTint

参数controlTint一个常量,表示所需的控制色调。 controlTint的有效值在 NSCell 中描述。

转到NSCell doc:

<强> setControlTint

设置接收者的控制色调。

- (void)setControlTint:(NSControlTint)controlTint

参数controlTint - 一个指定的初始值设定项值,用于指定接收方的色调。

指定初始值设定项

子类化NSCell时,必须实现所有指定的初始值设定项。这些方法包括:initinitWithCoder:initTextCell:initImageCell:

你必须继承NSProgressIndicator并且实现所有指定的初始值设定项。(见上文)。