我有一个非常简单的任务:当用户暂停进度时,将 NSProgressIndicator 的颜色更改为石墨,这是一个确定的进度条。我找到了setControlTint方法,但是使用它之后就没有效果了。我也搜索了很多没有太多明确的答案。子类 NSProgressIndicator 和做一些自定义绘图是必须的吗?我只是想知道为什么这种方法存在并且没有关于正确使用的进一步文档或讨论。
非常感谢您的帮助:)
我有一个非常简单的任务:当用户暂停进度时,将 NSProgressIndicator 的颜色更改为石墨,这是一个确定的进度条。我找到了setControlTint方法,但是使用它之后就没有效果了。我也搜索了很多没有太多明确的答案。子类 NSProgressIndicator 和做一些自定义绘图是必须的吗?我只是想知道为什么这种方法存在并且没有关于正确使用的进一步文档或讨论。
非常感谢您的帮助:)
See doc:
Doc for NSProgressIndicator setControlTint:
Sets the receiver’s control tint.
- (void)setControlTint:(NSControlTint)controlTint
Parameters controlTint
a constant indicating the desired control tint. Valid values for controlTint are described in NSCell.
Go to NSCell doc:
setControlTint:
Sets the receiver’s control tint.
- (void)setControlTint:(NSControlTint)controlTint
Parameters controlTint - an Designated Initializers value that specifies the tint of the receiver.
Designated Initializers
When subclassing NSCell
you must implement all of the designated initializers. Those methods are: init
, initWithCoder:
, initTextCell:
, and initImageCell:
.
In to words you must subclassing NSProgressIndicator and implement all of the designated initializers. (see above).