更改NSProgressIndicator的颜色? [英] Changing the color of NSProgressIndicator?

查看:467
本文介绍了更改NSProgressIndicator的颜色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

更改NSProgressIndicator颜色的最佳方法是什么,是否有比将其子类化然后自己绘制整个组件更简单的方法?

What is the best way to change the color of NSProgressIndicator, is there an easier way than just to subclass it and then draw the whole component by myself?

基本上我想要做的是具有类似的组件,但是能够更改条形的颜色.

Basically what I want to do is to have a similar component but with the ability to change the color of the bar.

我尝试用Google搜索它,但是所有问题都已经过时了,并且与我正在开发的10.10 OS X版本无关.还检查了可可粉控件,只找到了1个过时的OS X版本的组件.

I tried to google this but all the questions were quite outdated and didn't really concern the 10.10 OS X version that I am working on. Also checked cocoa controls and did only find 1 component that was for outdated OS X version.

推荐答案

您可以直接在Interface Builder中使用Quartz过滤器(例如,色相调整).效果比预期的好.

You can use Quartz filters (e.g. hue adjust) for this directly in Interface Builder. This works better than expected.

它在效果检查器中.在内容过滤器"下,您可以添加色相调整"

It's in the Effects Inspector. Under "Content Filters" you can add "Hue Adjust"

这篇关于更改NSProgressIndicator的颜色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆