NSDatepickerCell的高光颜色 [英] Hightlight color for NSDatepickerCell

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

问题描述

我正在尝试在Objective-C / Cocoa中做一个小计时器应用程序。我正在使用NSDatePicker来设置起始值。我设法将文本颜色更改为绿色,因为在HUD面板上整个应用程序将变为绿色:

I am trying to do a little timer app in Objective-C/Cocoa. I am using the NSDatePicker to be able to set the start value. I managed to change the text color to green, because the whole app will be in green on a HUD panel:

日期选择器右侧http://jeenaparadies.net/t/s/datepicker-right.png

但是有问题。每当我使用选择器更改值时,它都会用灰色突出显示它,除非您单击其他位置,否则您将无法确定它具有什么值:

But there is a problem. Whenever I am using the picker to change the value, it highlights it wit a gray color and you can't se what value it has unless you click somewhere else:

< a href = http://jeenaparadies.net/t/s/datepicker-wrong.png rel = nofollow noreferrer>日期选择器错误http://jeenaparadies.net/t/s/datepicker-wrong.png

我现在正在找几个小时,但是不知道如何解决它,有什么建议吗?

I am looking for hours now, but have no clue how to fix it, any suggestions?

推荐答案

NSDatePickerCell是NSCell的子类,它具有-highlightColorWithFrame:inView:方法,您可以重写该方法并返回所需的任何突出显示颜色。

NSDatePickerCell is a subclass of NSCell, which has the -highlightColorWithFrame:inView: method, which you can override and return any highlight color you wish.

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

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